Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
|
| 4 |
|
| 5 |
model_id = "NousResearch/Hermes-4-14B"
|
| 6 |
|
|
@@ -11,6 +12,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 11 |
device_map="auto"
|
| 12 |
)
|
| 13 |
|
|
|
|
| 14 |
def predict(message, history):
|
| 15 |
history.append({"role": "user", "content": message})
|
| 16 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 4 |
+
import spaces
|
| 5 |
|
| 6 |
model_id = "NousResearch/Hermes-4-14B"
|
| 7 |
|
|
|
|
| 12 |
device_map="auto"
|
| 13 |
)
|
| 14 |
|
| 15 |
+
@spaces.GPU(duration=120)
|
| 16 |
def predict(message, history):
|
| 17 |
history.append({"role": "user", "content": message})
|
| 18 |
|