Keeby-smilyai commited on
Commit
3319054
·
verified ·
1 Parent(s): 25e6919

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -1
app.py CHANGED
@@ -928,4 +928,34 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft(), title="SAM-Z-1 API") as d
928
 
929
  **Model**: SAM-Z-1 | **License**: Check model card on Hugging Face
930
  **Support**: Open an issue on the Space for bugs or questions
931
- """)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
928
 
929
  **Model**: SAM-Z-1 | **License**: Check model card on Hugging Face
930
  **Support**: Open an issue on the Space for bugs or questions
931
+ """)
932
+
933
+ # Event handlers for Chat Completion
934
+ chat_btn.click(
935
+ fn=chat_completion_api,
936
+ inputs=[
937
+ messages_input, chat_max_tokens, chat_temperature,
938
+ chat_top_p, chat_top_k, chat_rep_penalty, chat_stream
939
+ ],
940
+ outputs=[chat_output]
941
+ )
942
+
943
+ # Event handlers for Text Completion
944
+ text_btn.click(
945
+ fn=text_completion_api,
946
+ inputs=[
947
+ prompt_input, text_max_tokens, text_temperature,
948
+ text_top_p, text_top_k, text_rep_penalty, text_stream
949
+ ],
950
+ outputs=[text_output]
951
+ )
952
+
953
+ # Launch
954
+ if __name__ == "__main__":
955
+ demo.queue(max_size=20)
956
+ demo.launch(
957
+ server_name="0.0.0.0",
958
+ server_port=7860,
959
+ share=False,
960
+ show_error=True
961
+ )