Spaces:
Build error
Build error
update
Browse files5 unmodified lines678991010111213141516141718161920212230 unmodified lines535455565758596061626364656638 unmodified lines10510610710810911011111211311411513 unmodified lines1291301311191325 unmodified lines
# Hugging Face logintoken = os.environ.get("token")if token:login(token)print("Login is successful") login(token) print("Login is successful")else: print("Token not found. Please set your token in the environment variables.")
# Model and tokenizer setupMODEL_NAME = "google/flan-t5-base"tokenizer = T5Tokenizer.from_pretrained(MODEL_NAME, token=token)tokenizer = T5Tokenizer.from_pretrained(MODEL_NAME, use_auth_token=token)config = PeftConfig.from_pretrained("Komal-patra/results")base_model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")base_model = AutoModelForSeq2SeqLM.from_pretrained(MODEL_NAME)model = PeftModel.from_pretrained(base_model, "Komal-patra/results")
# Text generation function30 unmodified lines.gradio-container { background: #1c1c1c; /* Dark background */ color: white; /* Light text color */ height: 100vh; /* Full viewport height */ display: flex; flex-direction: column;}/* Chatbot messages container */.svelte-1s78gfg { flex-grow: 1; /* Allow it to grow and take available space */ overflow-y: auto; /* Enable vertical scrolling */}/* RED (Hex: #DB1616) for action buttons and links only */.clear-btn {38 unmodified lines submit_button = gr.Button("Submit", elem_classes="submit-btn") clear = gr.Button("Clear", elem_classes="clear-btn")
# Function to handle user input def user(user_message, history): return "", history + [[user_message, None]]
# Function to handle bot response def bot(history): if len(history) == 1: # Check if it's the first interaction bot_message = "Hi there! How can I help you today?"13 unmodified lines ) clear.click(lambda: None, None, chatbot, queue=False)
demo.launch()demo.launch(share=True)app.py+18-5