multimodalart HF Staff commited on
Commit
b186b15
·
verified ·
1 Parent(s): b7439a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
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").to("cuda")
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()