Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,16 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
|
|
|
|
|
|
|
|
3 |
|
4 |
-
|
5 |
|
|
|
6 |
|
|
|
|
|
7 |
def respond(
|
8 |
message,
|
9 |
history: list[tuple[str, str]],
|
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import InferenceClient
|
3 |
+
import spaces
|
4 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
+
import torch
|
6 |
+
from transformers import pipeline
|
7 |
|
8 |
+
pipe = pipeline("text-generation", model="microsoft/Phi-3-mini-128k-instruct", torch_dtype=torch.bfloat16, device_map="auto")
|
9 |
|
10 |
+
#client = InferenceClient("microsoft/Phi-3-mini-128k-instruct")
|
11 |
|
12 |
+
|
13 |
+
@spaces.GPU
|
14 |
def respond(
|
15 |
message,
|
16 |
history: list[tuple[str, str]],
|