Spaces:
Running
Running
Commit
•
ee22789
1
Parent(s):
56664f4
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,11 @@ from groq import Groq
|
|
3 |
import gradio as gr
|
4 |
from transformers import AutoModel, AutoConfig
|
5 |
|
|
|
|
|
6 |
try:
|
7 |
-
config = AutoConfig.from_pretrained("HusseinEid/llama-3-chatbot", config_file_name="config.json")
|
8 |
-
model = AutoModel.from_pretrained("HusseinEid/lora_model", config=config)
|
9 |
-
|
10 |
except OSError as e:
|
11 |
print(f"Error: {e}")
|
12 |
|
@@ -53,4 +54,4 @@ with gr. Blocks(theme=gr.themes.Monochrome(), fill_height=True) as demo:
|
|
53 |
)
|
54 |
|
55 |
demo.queue()
|
56 |
-
demo.launch(
|
|
|
3 |
import gradio as gr
|
4 |
from transformers import AutoModel, AutoConfig
|
5 |
|
6 |
+
hf_token = os.getenv("HF_TOKEN") # Make sure you set this environment variable
|
7 |
+
|
8 |
try:
|
9 |
+
config = AutoConfig.from_pretrained("HusseinEid/llama-3-chatbot", config_file_name="config.json", use_auth_token=hf_token)
|
10 |
+
model = AutoModel.from_pretrained("HusseinEid/lora_model", config=config, use_auth_token=hf_token)
|
|
|
11 |
except OSError as e:
|
12 |
print(f"Error: {e}")
|
13 |
|
|
|
54 |
)
|
55 |
|
56 |
demo.queue()
|
57 |
+
demo.launch()
|