Yoxas commited on
Commit
bf75b03
·
verified ·
1 Parent(s): 20c92ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,11 +1,11 @@
1
  import gradio as gr
2
- from transformers import AutoModel
3
  import spaces
4
 
5
  """
6
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
7
  """
8
- model = AutoModel.from_pretrained("Yoxas/autotrain-phi3-statistical", trust_remote_code=True)
9
 
10
  @spaces.GPU(duration=120)
11
  def respond(
@@ -28,7 +28,7 @@ def respond(
28
 
29
  response = ""
30
 
31
- for message in model.text_generation(
32
  messages,
33
  max_tokens=max_tokens,
34
  stream=True,
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
  import spaces
4
 
5
  """
6
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
7
  """
8
+ pipe = pipeline("text-generation", model="microsoft/Phi-3-mini-4k-instruct", trust_remote_code=True)
9
 
10
  @spaces.GPU(duration=120)
11
  def respond(
 
28
 
29
  response = ""
30
 
31
+ for message in pipe.text_generation(
32
  messages,
33
  max_tokens=max_tokens,
34
  stream=True,