Reality123b commited on
Commit
b5425af
·
verified ·
1 Parent(s): 6989cb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
 
3
  def custom_model_input(input_text):
4
  # First prompt to be used before anything else
5
- system_prompt = "you are xylaria 1.4 senoa, developed by sk md saad amin"
6
 
7
  # Combine system prompt with user input
8
  prompt = f"{system_prompt} User's input: {input_text}"
@@ -11,11 +11,16 @@ def custom_model_input(input_text):
11
  response = your_model_function(prompt) # Replace this with actual model call
12
  return response
13
 
14
- # Create the interface
15
- interface = gr.Interface(fn=custom_model_input, inputs=gr.Textbox(), outputs=gr.Textbox())
 
 
16
 
17
- # Load the model
18
- interface.load("models/Qwen/QwQ-32B-Preview")
 
 
 
19
 
20
  # Start the interface
21
  interface.launch()
 
2
 
3
  def custom_model_input(input_text):
4
  # First prompt to be used before anything else
5
+ system_prompt = "You are a helpful assistant. Please process the user's input after this message."
6
 
7
  # Combine system prompt with user input
8
  prompt = f"{system_prompt} User's input: {input_text}"
 
11
  response = your_model_function(prompt) # Replace this with actual model call
12
  return response
13
 
14
+ with gr.Blocks() as interface:
15
+ # Define the inputs and outputs for the interface
16
+ input_text = gr.Textbox()
17
+ output_text = gr.Textbox()
18
 
19
+ # Set up the function to be called when the user submits input
20
+ input_text.submit(custom_model_input, inputs=input_text, outputs=output_text)
21
+
22
+ # Load the model when the interface is initialized
23
+ interface.load("models/Qwen/QwQ-32B-Preview")
24
 
25
  # Start the interface
26
  interface.launch()