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