Arturo Jiménez de los Galanes Reguillos commited on
Commit
3b47068
·
1 Parent(s): 6c647a7

Add huggingface login

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -1,4 +1,11 @@
1
  import gradio as gr
 
 
 
 
 
 
 
2
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
 
1
  import gradio as gr
2
+ import os
3
+ from huggingface_hub import login
4
+ from dotenv import load_dotenv
5
+
6
+ load_dotenv()
7
+ hf_token = os.getenv('HF_TOKEN', 'your-key-if-not-using-env')
8
+ login(hf_token, add_to_git_credential=True)
9
 
10
  def greet(name):
11
  return "Hello " + name + "!!"