jeon commited on
Commit
d763db1
โ€ข
1 Parent(s): cd4e5ff
Files changed (1) hide show
  1. app.py +8 -15
app.py CHANGED
@@ -42,31 +42,24 @@ def get_completion_from_messages(input, model="gpt-3.5-turbo", temperature=0.8):
42
  #get completion ํ†ต๊ณผ ์‹œ์ผœ์„œ ๋‹ต๋ณ€์–ป์Œ
43
  #์ด๋•Œ ์—ญํ•  ๋ถ„๋‹ด ๋ฐ ํ”„๋กฌํ”„ํŠธ ์—”์ง€๋‹ˆ์–ด๋ง ์ง„ํ–‰
44
  ####
45
- class ChatBot:
46
  def __init__(self):
47
  # Initialize the ChatBot class with an empty history
48
  self.history = []
49
 
50
  def predict(self, user_input):
51
-
52
  response_text =get_completion_from_messages(user_input, temperature=0.8)
 
53
 
54
- return response_text # Return the generated response
55
-
56
-
57
- bot = ChatBot()
58
 
 
59
  title = "์ž์†Œ์„œ๊ธฐ๋ฐ˜ ๋ฉด์ ‘ ์‹œ๋ฎฌ๋ ˆ์ด์…˜ chat bot (this template based on Tonic's MistralMed Chat)"
60
- #description = "์ด ๊ณต๊ฐ„์„ ์‚ฌ์šฉํ•˜์—ฌ ํ˜„์žฌ ๋ชจ๋ธ์„ ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. [(Tonic/MistralMed)](https://huggingface.co/Tonic/MistralMed) ๋˜๋Š” ์ด ๊ณต๊ฐ„์„ ๋ณต์ œํ•˜๊ณ  ๋กœ์ปฌ ๋˜๋Š” ๐Ÿค—HuggingFace์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. [Discord์—์„œ ํ•จ๊ป˜ ๋งŒ๋“ค๊ธฐ ์œ„ํ•ด Discord์— ๊ฐ€์ž…ํ•˜์‹ญ์‹œ์˜ค](https://discord.gg/VqTxc76K3u). You can use this Space to test out the current model [(Tonic/MistralMed)](https://huggingface.co/Tonic/MistralMed) or duplicate this Space and use it locally or on ๐Ÿค—HuggingFace. [Join me on Discord to build together](https://discord.gg/VqTxc76K3u)."
61
- #examples = [["[Question:] What is the proper treatment for buccal herpes?",
62
- # "You are a medicine and public health expert, you will receive a question, answer the question, and provide a complete answer"]]
63
-
64
- iface = gr.Interface(
65
- fn=bot.predict,
66
  title=title,
67
- inputs=["text"], # Take user input and system prompt separately
68
  outputs="text",
69
- theme="ParityError/Anime"
70
  )
71
 
72
- iface.launch()
 
42
  #get completion ํ†ต๊ณผ ์‹œ์ผœ์„œ ๋‹ต๋ณ€์–ป์Œ
43
  #์ด๋•Œ ์—ญํ•  ๋ถ„๋‹ด ๋ฐ ํ”„๋กฌํ”„ํŠธ ์—”์ง€๋‹ˆ์–ด๋ง ์ง„ํ–‰
44
  ####
45
+ class Interviewer:
46
  def __init__(self):
47
  # Initialize the ChatBot class with an empty history
48
  self.history = []
49
 
50
  def predict(self, user_input):
 
51
  response_text =get_completion_from_messages(user_input, temperature=0.8)
52
+ return response_text
53
 
 
 
 
 
54
 
55
+ inter = Interviewer()
56
  title = "์ž์†Œ์„œ๊ธฐ๋ฐ˜ ๋ฉด์ ‘ ์‹œ๋ฎฌ๋ ˆ์ด์…˜ chat bot (this template based on Tonic's MistralMed Chat)"
57
+ chatbot = gr.Interface(
58
+ fn=inter.predict,
 
 
 
 
59
  title=title,
60
+ inputs="text",
61
  outputs="text",
62
+
63
  )
64
 
65
+ chatbot.launch()