Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,16 @@
|
|
1 |
from peft import AutoPeftModelForCausalLM
|
2 |
from transformers import AutoTokenizer, pipeline
|
3 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Load the model
|
6 |
model = AutoPeftModelForCausalLM.from_pretrained("Moritz-Pfeifer/financial-times-classification-llama-2-7b-v1.3")
|
|
|
1 |
from peft import AutoPeftModelForCausalLM
|
2 |
from transformers import AutoTokenizer, pipeline
|
3 |
import gradio as gr
|
4 |
+
from huggingface_hub import login
|
5 |
+
import os
|
6 |
+
|
7 |
+
# Huggingface Authentication
|
8 |
+
api_key = os.getenv('cs549_naacp_access_key')
|
9 |
+
|
10 |
+
if api_key is None:
|
11 |
+
raise ValueError("API_KEY is not set in the environment variables.")
|
12 |
+
|
13 |
+
login(api_key)
|
14 |
|
15 |
# Load the model
|
16 |
model = AutoPeftModelForCausalLM.from_pretrained("Moritz-Pfeifer/financial-times-classification-llama-2-7b-v1.3")
|