barathm2001 commited on
Commit
1c8abeb
·
verified ·
1 Parent(s): eb4a8ba

Upload 4 files

Browse files
Files changed (2) hide show
  1. .gitignore +1 -0
  2. 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")