Felguk commited on
Commit
135c183
·
verified ·
1 Parent(s): 85e3f0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -17
app.py CHANGED
@@ -17,21 +17,12 @@ purple_theme = gr.themes.Default(
17
  block_label_text_color="#673AB7",
18
  )
19
 
20
- # Load the model with no system prompt here
21
- model = gr.load("models/Qwen/Qwen3-235B-A22B", provider="nebius")
22
-
23
- # Define a wrapper function that injects the system prompt
24
- def respond(message, chat_history, system_prompt):
25
- # Prepend the system prompt to the message or handle accordingly
26
- full_input = f"System: {system_prompt}\nUser: {message}"
27
- response = model.predict(full_input) # Adjust depending on how the model expects input
28
- return response
29
-
30
- # Create a chat interface with a system prompt textbox
31
- with gr.Blocks(theme=purple_theme) as demo:
32
- system_prompt = gr.Textbox(value="You are a helpful assistant.", label="System Prompt")
33
- chatbot = gr.Chatbot()
34
- interface = gr.ChatInterface(fn=respond, additional_inputs=[system_prompt], chatbot=chatbot)
35
 
36
- # Launch
37
- demo.launch()
 
 
17
  block_label_text_color="#673AB7",
18
  )
19
 
20
+ # Create the interface with the theme
21
+ interface = gr.load(
22
+ "models/Qwen/Qwen3-235B-A22B",
23
+ provider="nebius"
24
+ )
 
 
 
 
 
 
 
 
 
 
25
 
26
+ # Set the theme before launching
27
+ interface.theme = purple_theme
28
+ interface.launch()