mintaeng commited on
Commit
0e9bf6e
โ€ข
1 Parent(s): f233426

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -22
app.py CHANGED
@@ -1,10 +1,4 @@
1
  import gradio as gr
2
- from huggingface_hub import InferenceClient
3
-
4
- """
5
- For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
- """
7
- client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
 
9
 
10
  def respond(
@@ -42,22 +36,38 @@ def respond(
42
  """
43
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
44
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  demo = gr.ChatInterface(
46
- respond,
47
- additional_inputs=[
48
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
49
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
50
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
51
- gr.Slider(
52
- minimum=0.1,
53
- maximum=1.0,
54
- value=0.95,
55
- step=0.05,
56
- label="Top-p (nucleus sampling)",
57
- ),
58
- ],
 
 
59
  )
 
60
 
61
-
62
- if __name__ == "__main__":
63
- demo.launch()
 
1
  import gradio as gr
 
 
 
 
 
 
2
 
3
 
4
  def respond(
 
36
  """
37
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
38
  """
39
+ TITLE = "FUT FUT Chatbot"
40
+
41
+ DESCRIPTION = """
42
+ 'ํ•ด์š”'์ฒด๋ฅผ ์‚ฌ์šฉํ•˜๋ฉฐ ์นœ์ ˆํ•˜๊ฒŒ ๋‹ตํ•˜๋Š” ํ’‹ํ’‹์ด ์ฑ—๋ด‡.
43
+ A rag pipeline with a chatbot feature
44
+ Resources used to build this project :
45
+ * embedding model : https://huggingface.co/BM-K/KoSimCSE-roberta-multitask
46
+ * dataset : https://huggingface.co/datasets/Dongwookss/q_a_korean_futsal
47
+ * vector DB : PINECONE
48
+ * chatbot : https://huggingface.co/Dongwookss/small_fut_final
49
+ """
50
+
51
+ Examples = [['์‹œํฅ ํ’‹์‚ด ๊ตฌ์žฅ ์ถ”์ฒœํ•ด์ค˜'],['ํ’‹์‚ด ๊ฒฝ๊ธฐ ๊ทœ์น™ ์„ค๋ช…ํ•ด์ค˜'], ['ํ’‹์‚ด ๊ฒฝ๊ธฐ ์‹œ๊ฐ„ ์•Œ๋ ค์ค˜']]
52
+
53
  demo = gr.ChatInterface(
54
+ fn=talk,
55
+ chatbot=gr.Chatbot(
56
+ show_label=True,
57
+ show_share_button=True,
58
+ show_copy_button=True,
59
+ likeable=True,
60
+ layout="bubble",
61
+ bubble_full_width=False,
62
+ ),
63
+ theme="Soft",
64
+ examples=[["what's anarchy ? "]],
65
+ title=TITLE,
66
+ description=DESCRIPTION,
67
+ examples=Examples
68
+
69
  )
70
+ demo.launch(debug=True)
71
 
72
+ # if __name__ == "__main__":
73
+ # demo.launch()