Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,14 @@
|
|
1 |
-
|
2 |
import gradio as gr
|
3 |
from typing import Iterator, List, Tuple
|
4 |
import torch
|
5 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
6 |
from peft import PeftConfig, PeftModel
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
base_model = "mistralai/Mistral-7B-Instruct-v0.2"
|
9 |
adapter = "GRMenon/mental-health-mistral-7b-instructv0.2-finetuned-V2"
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from typing import Iterator, List, Tuple
|
3 |
import torch
|
4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
5 |
from peft import PeftConfig, PeftModel
|
6 |
+
from huggingface_hub import login
|
7 |
+
import os
|
8 |
+
|
9 |
+
# Authenticate with Hugging Face
|
10 |
+
HUGGINGFACE_TOKEN = os.getenv('HUGGINGFACE_TOKEN') # Ensure this environment variable is set
|
11 |
+
login(token=HUGGINGFACE_TOKEN)
|
12 |
|
13 |
base_model = "mistralai/Mistral-7B-Instruct-v0.2"
|
14 |
adapter = "GRMenon/mental-health-mistral-7b-instructv0.2-finetuned-V2"
|