Spaces:
Runtime error
Runtime error
Upload 4 files
Browse files- .gitignore +1 -0
- app.py +4 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.env
|
app.py
CHANGED
@@ -3,6 +3,10 @@ from fastapi import FastAPI
|
|
3 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
4 |
from peft import PeftModel, PeftConfig
|
5 |
from huggingface_hub import login
|
|
|
|
|
|
|
|
|
6 |
|
7 |
# Get the Hugging Face token from the environment variable
|
8 |
huggingface_token = os.getenv("HUGGING_FACE_TOKEN")
|
|
|
3 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
4 |
from peft import PeftModel, PeftConfig
|
5 |
from huggingface_hub import login
|
6 |
+
from dotenv import load_dotenv
|
7 |
+
|
8 |
+
# Load environment variables from .env file
|
9 |
+
load_dotenv()
|
10 |
|
11 |
# Get the Hugging Face token from the environment variable
|
12 |
huggingface_token = os.getenv("HUGGING_FACE_TOKEN")
|