File size: 721 Bytes
df4d5d7 19894a8 df4d5d7 6bb7d92 19894a8 b36700e 9a2f868 19894a8 6bb7d92 19894a8 9a2f868 df4d5d7 6bb7d92 df4d5d7 9a2f868 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import streamlit as st
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel, PeftConfig
from huggingface_hub import login
# Set page config for better display
st.set_page_config(page_title="LLaMA Chatbot", page_icon="π¦")
status_placeholder = st.empty()
# Set your HuggingFace token
try:
hf_token = st.secrets["HF_TOKEN"]
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")
# Rest of the code... |