Spaces:
Build error
Build error
update
Browse files5 unmodified lines67891011121314151617181930 unmodified lines50515253545538 unmodified lines94959697989910010110213 unmodified lines1161171181195 unmodified lines# Hugging Face logintoken = os.environ.get("token")login(token)print("Login is successful")# Model and tokenizer setupMODEL_NAME = "google/flan-t5-base"tokenizer = T5Tokenizer.from_pretrained(MODEL_NAME, token=token)config = PeftConfig.from_pretrained("Komal-patra/results")base_model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-base")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 */}/* RED (Hex: #DB1616) for action buttons and links only */.clear-btn {38 unmodified linessubmit_button = gr.Button("Submit", elem_classes="submit-btn")clear = gr.Button("Clear", elem_classes="clear-btn")def user(user_message, history):return "", history + [[user_message, None]]def bot(history):if len(history) == 1: # Check if it's the first interactionbot_message = "Hi there! How can I help you today?"13 unmodified lines)clear.click(lambda: None, None, chatbot, queue=False)demo.launch()5 unmodified lines67891011121314151617181920212230 unmodified lines535455565758596061626364656638 unmodified lines10510610710810911011111211311411513 unmodified lines1291301311325 unmodified lines# Hugging Face logintoken = os.environ.get("token")if token: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, use_auth_token=token)config = PeftConfig.from_pretrained("Komal-patra/results")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 linessubmit_button = gr.Button("Submit", elem_classes="submit-btn")clear = gr.Button("Clear", elem_classes="clear-btn")# Function to handle user inputdef user(user_message, history):return "", history + [[user_message, None]]# Function to handle bot responsedef bot(history):if len(history) == 1: # Check if it's the first interactionbot_message = "Hi there! How can I help you today?"13 unmodified lines)clear.click(lambda: None, None, chatbot, queue=False)demo.launch(share=True)
app.py+18-5