anaspro
commited on
Commit
·
84f8e84
1
Parent(s):
510e121
Fix compatibility issues with Gradio on Spaces
Browse files- Remove system_prompt parameter from generate_response function
- Move title from launch() to ChatInterface initialization
- Remove unsupported favicon parameter
- Use standard launch parameters compatible with Spaces
- Fix argument mismatch warnings
app.py
CHANGED
|
@@ -69,7 +69,7 @@ def format_conversation_history(chat_history):
|
|
| 69 |
return messages
|
| 70 |
|
| 71 |
@spaces.GPU()
|
| 72 |
-
def generate_response(input_data, chat_history, max_new_tokens,
|
| 73 |
new_message = {"role": "user", "content": input_data}
|
| 74 |
processed_history = format_conversation_history(chat_history)
|
| 75 |
effort, instructions = parse_reasoning_and_instructions(DEFAULT_SYSTEM_PROMPT)
|
|
@@ -138,6 +138,7 @@ demo = gr.ChatInterface(
|
|
| 138 |
],
|
| 139 |
cache_examples=False,
|
| 140 |
type="messages",
|
|
|
|
| 141 |
description="""🤖 مساعد ذكي متقدم يعتمد على anaspro/Lahja-iraqi-4B من anaspro للدعم الفني بشبكة النور - NB TEL
|
| 142 |
|
| 143 |
✨ قدرات متقدمة:
|
|
@@ -162,7 +163,9 @@ demo = gr.ChatInterface(
|
|
| 162 |
|
| 163 |
if __name__ == "__main__":
|
| 164 |
demo.launch(
|
| 165 |
-
|
| 166 |
-
|
|
|
|
|
|
|
| 167 |
css=".gradio-container {direction: rtl;}"
|
| 168 |
)
|
|
|
|
| 69 |
return messages
|
| 70 |
|
| 71 |
@spaces.GPU()
|
| 72 |
+
def generate_response(input_data, chat_history, max_new_tokens, temperature, top_p, top_k, repetition_penalty):
|
| 73 |
new_message = {"role": "user", "content": input_data}
|
| 74 |
processed_history = format_conversation_history(chat_history)
|
| 75 |
effort, instructions = parse_reasoning_and_instructions(DEFAULT_SYSTEM_PROMPT)
|
|
|
|
| 138 |
],
|
| 139 |
cache_examples=False,
|
| 140 |
type="messages",
|
| 141 |
+
title="مساعد NB TEL للدعم الفني - Lahja-iraqi-4B",
|
| 142 |
description="""🤖 مساعد ذكي متقدم يعتمد على anaspro/Lahja-iraqi-4B من anaspro للدعم الفني بشبكة النور - NB TEL
|
| 143 |
|
| 144 |
✨ قدرات متقدمة:
|
|
|
|
| 163 |
|
| 164 |
if __name__ == "__main__":
|
| 165 |
demo.launch(
|
| 166 |
+
share=False,
|
| 167 |
+
server_name="0.0.0.0",
|
| 168 |
+
server_port=7860,
|
| 169 |
+
debug=False,
|
| 170 |
css=".gradio-container {direction: rtl;}"
|
| 171 |
)
|