Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ model_name = "unsloth/Llama-3.2-1B-Instruct"
|
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(
|
| 9 |
model_name,
|
| 10 |
-
|
| 11 |
device_map="auto"
|
| 12 |
)
|
| 13 |
|
|
@@ -68,10 +68,7 @@ demo = gr.ChatInterface(
|
|
| 68 |
"Write a short poem about coding",
|
| 69 |
"Explain quantum computing in simple terms"
|
| 70 |
],
|
| 71 |
-
theme=gr.themes.Soft()
|
| 72 |
-
retry_btn="Retry",
|
| 73 |
-
undo_btn="Undo",
|
| 74 |
-
clear_btn="Clear"
|
| 75 |
)
|
| 76 |
|
| 77 |
if __name__ == "__main__":
|
|
|
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(
|
| 9 |
model_name,
|
| 10 |
+
dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
|
| 11 |
device_map="auto"
|
| 12 |
)
|
| 13 |
|
|
|
|
| 68 |
"Write a short poem about coding",
|
| 69 |
"Explain quantum computing in simple terms"
|
| 70 |
],
|
| 71 |
+
theme=gr.themes.Soft()
|
|
|
|
|
|
|
|
|
|
| 72 |
)
|
| 73 |
|
| 74 |
if __name__ == "__main__":
|