Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 = "
|
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 |
-
|
15 |
-
|
|
|
|
|
16 |
|
17 |
-
#
|
18 |
-
|
|
|
|
|
|
|
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()
|