Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
-
from huggingface_hub import InferenceClient
|
3 |
from unsloth import FastLanguageModel
|
4 |
|
5 |
|
6 |
"""
|
7 |
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
|
8 |
"""
|
9 |
-
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
10 |
|
11 |
|
12 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
@@ -38,7 +38,8 @@ def texto_Patol(input):
|
|
38 |
"", # input
|
39 |
"", # output - leave this blank for generation!
|
40 |
)
|
41 |
-
], return_tensors = "pt")
|
|
|
42 |
|
43 |
outputs = model.generate(**inputs, max_new_tokens = 2048, use_cache = True)
|
44 |
return tokenizer.batch_decode(outputs)
|
|
|
1 |
import gradio as gr
|
2 |
+
#from huggingface_hub import InferenceClient
|
3 |
from unsloth import FastLanguageModel
|
4 |
|
5 |
|
6 |
"""
|
7 |
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
|
8 |
"""
|
9 |
+
#client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
10 |
|
11 |
|
12 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
|
|
38 |
"", # input
|
39 |
"", # output - leave this blank for generation!
|
40 |
)
|
41 |
+
], return_tensors = "pt")
|
42 |
+
#.to("cuda")
|
43 |
|
44 |
outputs = model.generate(**inputs, max_new_tokens = 2048, use_cache = True)
|
45 |
return tokenizer.batch_decode(outputs)
|