Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ import gradio as gr
|
|
| 8 |
text_generator = None
|
| 9 |
is_hugging_face = True
|
| 10 |
model_id = "google/gemma-2-9b-it"
|
|
|
|
| 11 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
| 12 |
device = "auto" # torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 13 |
device = "cuda"
|
|
@@ -52,7 +53,7 @@ if not is_hugging_face:
|
|
| 52 |
|
| 53 |
print("initialized")
|
| 54 |
|
| 55 |
-
@spaces.GPU(duration=
|
| 56 |
def generate_text(messages):
|
| 57 |
if is_hugging_face:#need everytime initialize for ZeroGPU
|
| 58 |
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
| 8 |
text_generator = None
|
| 9 |
is_hugging_face = True
|
| 10 |
model_id = "google/gemma-2-9b-it"
|
| 11 |
+
model_id = "google/gemma-2-2b-it"
|
| 12 |
huggingface_token = os.getenv("HUGGINGFACE_TOKEN")
|
| 13 |
device = "auto" # torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 14 |
device = "cuda"
|
|
|
|
| 53 |
|
| 54 |
print("initialized")
|
| 55 |
|
| 56 |
+
@spaces.GPU(duration=60)
|
| 57 |
def generate_text(messages):
|
| 58 |
if is_hugging_face:#need everytime initialize for ZeroGPU
|
| 59 |
model = AutoModelForCausalLM.from_pretrained(
|