nikunjcepatel commited on
Commit
0e7a53c
·
verified ·
1 Parent(s): 12e505f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -1,5 +1,14 @@
1
  import gradio as gr
2
  from transformers import AutoTokenizer, AutoModelForCausalLM
 
 
 
 
 
 
 
 
 
3
 
4
  # Load model and tokenizer
5
  model_name = "meta-llama/Llama-3.2-1B" # Replace with the correct model name if necessary
 
1
  import gradio as gr
2
  from transformers import AutoTokenizer, AutoModelForCausalLM
3
+ from huggingface_hub import login
4
+ import os
5
+
6
+ # Retrieve the Hugging Face token from the Space secrets
7
+ token = os.getenv("HF_TOKEN")
8
+
9
+ # Log in using the token
10
+ login(token=token)
11
+
12
 
13
  # Load model and tokenizer
14
  model_name = "meta-llama/Llama-3.2-1B" # Replace with the correct model name if necessary