0num4 commited on
Commit
9ef92c0
1 Parent(s): a3bef9a

cudaにすれば5sぐらいが目標で

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -1,5 +1,8 @@
1
  import gradio as gr # type: ignore
 
2
  import spaces # type: ignore
 
 
3
 
4
  # Load model directly
5
  from transformers import AutoTokenizer, AutoModelForCausalLM
@@ -11,6 +14,8 @@ model = AutoModelForCausalLM.from_pretrained(
11
  "microsoft/Phi-3-mini-4k-instruct", trust_remote_code=True
12
  )
13
 
 
 
14
 
15
  def greet(name, sliderint):
16
  return "Hellonyaaaaa " + name + "!!" + str(sliderint)
 
1
  import gradio as gr # type: ignore
2
+
3
  import spaces # type: ignore
4
+ import torch
5
+
6
 
7
  # Load model directly
8
  from transformers import AutoTokenizer, AutoModelForCausalLM
 
14
  "microsoft/Phi-3-mini-4k-instruct", trust_remote_code=True
15
  )
16
 
17
+ model.to("cuda")
18
+
19
 
20
  def greet(name, sliderint):
21
  return "Hellonyaaaaa " + name + "!!" + str(sliderint)