Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,17 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
2 |
|
3 |
"""
|
4 |
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
|
5 |
"""
|
6 |
# Load model directly
|
7 |
-
from transformers import
|
8 |
-
model = AutoModel.from_pretrained("Jagad1234unique/Uni_stu")
|
9 |
|
|
|
|
|
10 |
|
11 |
def respond(
|
12 |
message,
|
|
|
1 |
import gradio as gr
|
2 |
+
# Use a pipeline as a high-level helper
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
pipe = pipeline("text-generation", model="tiiuae/falcon-40b", trust_remote_code=True)
|
6 |
|
7 |
"""
|
8 |
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
|
9 |
"""
|
10 |
# Load model directly
|
11 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
12 |
|
13 |
+
tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-40b", trust_remote_code=True)
|
14 |
+
model = AutoModelForCausalLM.from_pretrained("tiiuae/falcon-40b", trust_remote_code=True)
|
15 |
|
16 |
def respond(
|
17 |
message,
|