File size: 1,209 Bytes
56f1953
ba99c5c
 
 
4a7c6e4
ba99c5c
 
 
4a7c6e4
 
ba99c5c
4a7c6e4
99d3b91
 
56f1953
ba99c5c
 
 
 
 
 
 
 
 
99d3b91
56f1953
ba99c5c
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import gradio as gr
# import pandas as pd
# from sentence_transformers import SentenceTransformer
# from sklearn.metrics.pairwise import cosine_similarity

# title = "๐Ÿ€๊ณ ๋ฏผ ํ•ด๊ฒฐ ๋„์„œ ์ถ”์ฒœ ์ฑ—๋ด‡๐Ÿ€"
# description = "๊ณ ๋ฏผ์ด ๋ฌด์—‡์ธ๊ฐ€์š”? ๊ณ ๋ฏผ ํ•ด๊ฒฐ์„ ๋„์™€์ค„ ์ฑ…์„ ์ถ”์ฒœํ•ด๋“œ๋ฆฝ๋‹ˆ๋‹ค"
# examples = [["์š”์ฆ˜ ์ž ์ด ์•ˆ ์˜จ๋‹ค"]]


# model = SentenceTransformer('jhgan/ko-sroberta-multitask')

def response(message, history):
    return message

gr.ChatInterface(
        fn=response,
        textbox=gr.Textbox(placeholder="๋ง๊ฑธ์–ด์ฃผ์„ธ์š”..", container=False, scale=7),
        title="์–ด๋–ค ์ฑ—๋ด‡์„ ์›ํ•˜์‹ฌ๋ฏธ๊นŒ?",
        description="๋ฌผ์–ด๋ณด๋ฉด ๋‹ตํ•˜๋Š” ์ฑ—๋ด‡์ž„๋ฏธ๋‹ค.",
        theme="soft",
        examples=[["์•ˆ๋‡ฝ"], ["์š”์ฆ˜ ๋ฅ๋‹ค ใ… ใ… "], ["์ ์‹ฌ๋ฉ”๋‰ด ์ถ”์ฒœ๋ฐ”๋žŒ, ์งœ์žฅ ์งฌ๋ฝ• ํƒ 1"]],
        retry_btn="๋‹ค์‹œ๋ณด๋‚ด๊ธฐ โ†ฉ",
        undo_btn="์ด์ „์ฑ— ์‚ญ์ œ โŒ",
        clear_btn="์ „์ฑ— ์‚ญ์ œ ๐Ÿ’ซ").launch()

# gr.Interface(
#     fn=response,
#     title=title,
#     description=description,
#     examples=examples,
#     inputs=["text", "state"],
#     outputs=["chatbot", "state"],
#     theme="finlaymacklon/boxy_violet",
# ).launch()