JaphetHernandez commited on
Commit
dc398bf
1 Parent(s): 7cd4772

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,10 +1,13 @@
1
  import getpass
2
  import os
3
  from langchain import HuggingFaceHub
 
 
4
  #os.environ["MISTRAL_API_KEY"] = getpass.getpass()
5
  #os.environ["HF_TOKEN"] = getpass.getpass()
6
- from huggingface_hub import login
7
- login(token='HF_TOKEN')
 
8
  #api_key = os.getenv("HF_TOKEN")
9
  client = HuggingFaceHub(repo_id = 'mistralai/Mathstral-7B-v0.1') # 'mistralai/Mathstral-7B-v0.1')
10
  prompt = "What is the best French cheese?"
 
1
  import getpass
2
  import os
3
  from langchain import HuggingFaceHub
4
+ import streamlit as st
5
+ from huggingface_hub import login
6
  #os.environ["MISTRAL_API_KEY"] = getpass.getpass()
7
  #os.environ["HF_TOKEN"] = getpass.getpass()
8
+ # Token Secret of Hugging Face
9
+ huggingface_token = st.secrets["HF_TOKEN"]
10
+ login(huggingface_token)
11
  #api_key = os.getenv("HF_TOKEN")
12
  client = HuggingFaceHub(repo_id = 'mistralai/Mathstral-7B-v0.1') # 'mistralai/Mathstral-7B-v0.1')
13
  prompt = "What is the best French cheese?"