Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,7 +52,7 @@ def init():
|
|
| 52 |
|
| 53 |
@spaces.GPU(duration=120)
|
| 54 |
def generate_text(messages):
|
| 55 |
-
|
| 56 |
model = AutoModelForCausalLM.from_pretrained(
|
| 57 |
model_id, token=huggingface_token ,torch_dtype=dtype,device_map=device
|
| 58 |
)
|
|
|
|
| 52 |
|
| 53 |
@spaces.GPU(duration=120)
|
| 54 |
def generate_text(messages):
|
| 55 |
+
if is_hugging_face:#need everytime initialize for ZeroGPU
|
| 56 |
model = AutoModelForCausalLM.from_pretrained(
|
| 57 |
model_id, token=huggingface_token ,torch_dtype=dtype,device_map=device
|
| 58 |
)
|