Update app.py
Browse files
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 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
)
|
|
|
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 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()
|
|
|