|
import streamlit as st |
|
import torch |
|
from transformers import AutoTokenizer, AutoModelForCausalLM |
|
from peft import PeftModel, PeftConfig |
|
from huggingface_hub import login |
|
|
|
|
|
st.set_page_config(page_title="LLaMA Chatbot", page_icon="π¦") |
|
status_placeholder = st.empty() |
|
|
|
|
|
try: |
|
hf_token = st.secrets["HF_TOKEN25"] |
|
status_placeholder.success("π Successfully found HF token in secrets!") |
|
login(token=hf_token) |
|
status_placeholder.success("π Successfully logged in to Hugging Face!") |
|
except Exception as e: |
|
status_placeholder.error(f"π« Error with HF token: {str(e)}") |
|
st.stop() |
|
|
|
st.title("π¦ LLaMA Chatbot") |
|
|
|
|