openfree commited on
Commit
9a70f56
ยท
verified ยท
1 Parent(s): 5eb62f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +63 -58
app.py CHANGED
@@ -772,68 +772,73 @@ title_html = """
772
  </p>
773
  """
774
 
775
- # ์ˆ˜์ •๋œ ์‹œ์Šคํ…œ ํ”„๋กฌํ”„ํŠธ: ์ž…๋ ฅ ์–ธ์–ด์— ๋งž์ถฐ ์‘๋‹ตํ•˜๋„๋ก ์ง€์‹œ
776
- system_prompt_box = gr.Textbox(
777
- lines=3,
778
- value="You are a deep thinking AI. Please respond in the same language as the input prompt. If the input is in English, answer in English. If it is in another language (e.g., Korean, Japanese), answer in that language using your full reasoning capabilities.",
779
- visible=False # ํ™”๋ฉด์—์„œ ๊ฐ์ถค
780
- )
781
-
782
- max_tokens_slider = gr.Slider(
783
- label="Max New Tokens",
784
- minimum=100,
785
- maximum=8000,
786
- step=50,
787
- value=1000,
788
- visible=False # ํ™”๋ฉด์—์„œ ๊ฐ์ถค
789
- )
790
-
791
- web_search_checkbox = gr.Checkbox(
792
- label="Deep Research",
793
- value=False
794
- )
795
 
796
- web_search_text = gr.Textbox(
797
- lines=1,
798
- label="(Unused) Web Search Query",
799
- placeholder="No direct input needed",
800
- visible=False # ํ™”๋ฉด์—์„œ ๊ฐ์ถค
801
- )
802
 
803
- # ์ฑ„ํŒ… ์ธํ„ฐํŽ˜์ด์Šค ๊ตฌ์„ฑ
804
- chat = gr.ChatInterface(
805
- fn=run,
806
- type="messages",
807
- chatbot=gr.Chatbot(type="messages", scale=1, allow_tags=["image"]),
808
- textbox=gr.MultimodalTextbox(
809
- file_types=[
810
- ".webp", ".png", ".jpg", ".jpeg", ".gif",
811
- ".mp4", ".csv", ".txt", ".pdf"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
812
  ],
813
- file_count="multiple",
814
- autofocus=True
815
- ),
816
- multimodal=True,
817
- additional_inputs=[
818
- system_prompt_box,
819
- max_tokens_slider,
820
- web_search_checkbox,
821
- web_search_text,
822
- ],
823
- stop_btn=False,
824
- title='<a href="https://discord.gg/openfreeai" target="_blank">https://discord.gg/openfreeai</a>',
825
- examples=examples,
826
- run_examples_on_click=False,
827
- cache_examples=False,
828
- css_paths=None,
829
- delete_cache=(1800, 1800),
830
- )
831
 
832
- # ์˜ˆ์ œ ์„น์…˜ - ์ด๋ฏธ ChatInterface์— examples๊ฐ€ ์„ค์ •๋˜์–ด ์žˆ์œผ๋ฏ€๋กœ ์—ฌ๊ธฐ์„œ๋Š” ์„ค๋ช…๋งŒ ํ‘œ์‹œ
833
- with gr.Row(elem_id="examples_row"):
834
- with gr.Column(scale=12, elem_id="examples_container"):
835
- gr.Markdown("### Example Inputs (click to load)")
836
 
837
  if __name__ == "__main__":
838
  # Run locally
839
- chat.launch()
 
772
  </p>
773
  """
774
 
775
+ with gr.Blocks(css=css, title="Gemma3-R1984-27B") as demo:
776
+ gr.Markdown(title_html)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
777
 
778
+ # Display the web search option (while the system prompt and token slider remain hidden)
779
+ web_search_checkbox = gr.Checkbox(
780
+ label="Deep Research",
781
+ value=False
782
+ )
 
783
 
784
+ # Used internally but not visible to the user
785
+ system_prompt_box = gr.Textbox(
786
+ lines=3,
787
+ value="Please answer in English. You are a deep thinking AI that may use extremely long chains of thought to thoroughly analyze the problem and deliberate using systematic reasoning processes to arrive at a correct solution before answering. You have the ability to read sources in other languages, but you must always answer in English. Even if the search results are in another language, answer in English.",
788
+ visible=False # hidden from view
789
+ )
790
+
791
+ max_tokens_slider = gr.Slider(
792
+ label="Max New Tokens",
793
+ minimum=100,
794
+ maximum=8000,
795
+ step=50,
796
+ value=1000,
797
+ visible=False # hidden from view
798
+ )
799
+
800
+ web_search_text = gr.Textbox(
801
+ lines=1,
802
+ label="(Unused) Web Search Query",
803
+ placeholder="No direct input needed",
804
+ visible=False # hidden from view
805
+ )
806
+
807
+ # Configure the chat interface
808
+ chat = gr.ChatInterface(
809
+ fn=run,
810
+ type="messages",
811
+ chatbot=gr.Chatbot(type="messages", scale=1, allow_tags=["image"]),
812
+ textbox=gr.MultimodalTextbox(
813
+ file_types=[
814
+ ".webp", ".png", ".jpg", ".jpeg", ".gif",
815
+ ".mp4", ".csv", ".txt", ".pdf"
816
+ ],
817
+ file_count="multiple",
818
+ autofocus=True
819
+ ),
820
+ multimodal=True,
821
+ additional_inputs=[
822
+ system_prompt_box,
823
+ max_tokens_slider,
824
+ web_search_checkbox,
825
+ web_search_text,
826
  ],
827
+ stop_btn=False,
828
+ title='<a href="https://discord.gg/openfreeai" target="_blank">https://discord.gg/openfreeai</a>',
829
+ examples=examples,
830
+ run_examples_on_click=False,
831
+ cache_examples=False,
832
+ css_paths=None,
833
+ delete_cache=(1800, 1800),
834
+ )
835
+
836
+ # Example section - since examples are already set in ChatInterface, this is for display only
837
+ with gr.Row(elem_id="examples_row"):
838
+ with gr.Column(scale=12, elem_id="examples_container"):
839
+ gr.Markdown("### Example Inputs (click to load)")
 
 
 
 
 
840
 
 
 
 
 
841
 
842
  if __name__ == "__main__":
843
  # Run locally
844
+ demo.launch()