Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,6 @@ import spaces
|
|
| 6 |
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct")
|
| 8 |
model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct")
|
| 9 |
-
model.to("cuda")
|
| 10 |
|
| 11 |
print("Loading finished.")
|
| 12 |
|
|
@@ -430,7 +429,7 @@ def get_beam_search_html(
|
|
| 430 |
):
|
| 431 |
input_with_template=f"<|im_start|>system /n You are a helpful chatbot.<|im_end|><|im_start|>{input_text}"
|
| 432 |
|
| 433 |
-
inputs = tokenizer([input_with_template], return_tensors="pt")
|
| 434 |
|
| 435 |
outputs = model.generate(
|
| 436 |
**inputs,
|
|
@@ -501,4 +500,4 @@ with gr.Blocks(
|
|
| 501 |
outputs=[out_html, out_markdown],
|
| 502 |
)
|
| 503 |
|
| 504 |
-
demo.launch()
|
|
|
|
| 6 |
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct")
|
| 8 |
model = AutoModelForCausalLM.from_pretrained("HuggingFaceTB/SmolLM2-360M-Instruct")
|
|
|
|
| 9 |
|
| 10 |
print("Loading finished.")
|
| 11 |
|
|
|
|
| 429 |
):
|
| 430 |
input_with_template=f"<|im_start|>system /n You are a helpful chatbot.<|im_end|><|im_start|>{input_text}"
|
| 431 |
|
| 432 |
+
inputs = tokenizer([input_with_template], return_tensors="pt")
|
| 433 |
|
| 434 |
outputs = model.generate(
|
| 435 |
**inputs,
|
|
|
|
| 500 |
outputs=[out_html, out_markdown],
|
| 501 |
)
|
| 502 |
|
| 503 |
+
demo.launch()
|