Spaces:
Sleeping
Sleeping
File size: 922 Bytes
ef37daa e1ff28f 6989cb8 b5425af f69c6af 6989cb8 f69c6af 6989cb8 e0b816f b5425af e1ff28f b5425af fe44201 6989cb8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import gradio as gr
def custom_model_input(input_text):
# First prompt to be used before anything else
system_prompt = "You are a helpful assistant. Please process the user's input after this message."
# Combine system prompt with user input
prompt = f"{system_prompt} User's input: {input_text}"
# Call your model with the combined prompt
response = your_model_function(prompt) # Replace this with actual model call
return response
with gr.Blocks() as interface:
# Define the inputs and outputs for the interface
input_text = gr.Textbox()
output_text = gr.Textbox()
# Set up the function to be called when the user submits input
input_text.submit(custom_model_input, inputs=input_text, outputs=output_text)
# Load the model when the interface is initialized
interface.load("models/Qwen/QwQ-32B-Preview")
# Start the interface
interface.launch()
|