Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
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 |
-
|
9 |
|
10 |
@spaces.GPU(duration=120)
|
11 |
def respond(
|
@@ -28,7 +28,7 @@ def respond(
|
|
28 |
|
29 |
response = ""
|
30 |
|
31 |
-
for message in
|
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,
|