Mathstral / app.py
JaphetHernandez's picture
Update app.py
0a421a5 verified
raw
history blame
576 Bytes
import getpass
import os
from langchain import HuggingFaceHub
import streamlit as st
from huggingface_hub import login
#os.environ["MISTRAL_API_KEY"] = getpass.getpass()
#os.environ["HF_TOKEN"] = getpass.getpass()
# Token Secret of Hugging Face
huggingface_token = st.secrets["TF_TOKEN2"]
login(huggingface_token)
#api_key = os.getenv("HF_TOKEN2")
client = HuggingFaceHub(repo_id = 'mistralai/Mathstral-7B-v0.1', huggingfacehub_api_token=huggingface_token) # 'mistralai/Mathstral-7B-v0.1')
prompt = "What is the best French cheese?"
response = client(prompt)
print(response)