Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
-
from huggingface_hub import
|
|
|
3 |
|
4 |
"""
|
5 |
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
|
6 |
"""
|
7 |
-
client =
|
8 |
-
|
9 |
|
|
|
10 |
def respond(
|
11 |
message,
|
12 |
history: list[tuple[str, str]],
|
@@ -27,7 +28,7 @@ def respond(
|
|
27 |
|
28 |
response = ""
|
29 |
|
30 |
-
for message in client.
|
31 |
messages,
|
32 |
max_tokens=max_tokens,
|
33 |
stream=True,
|
|
|
1 |
import gradio as gr
|
2 |
+
from huggingface_hub 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 |
+
client = pipeline("text-generation", model="Yoxas/autotrain-phi3-statistical")
|
|
|
9 |
|
10 |
+
@spaces.GPU(duration=120)
|
11 |
def respond(
|
12 |
message,
|
13 |
history: list[tuple[str, str]],
|
|
|
28 |
|
29 |
response = ""
|
30 |
|
31 |
+
for message in client.text_generation(
|
32 |
messages,
|
33 |
max_tokens=max_tokens,
|
34 |
stream=True,
|