missvector commited on
Commit
43c17bb
·
1 Parent(s): 9de8106

upd app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -8
app.py CHANGED
@@ -10,10 +10,7 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
10
  def respond(
11
  message,
12
  history: list[tuple[str, str]],
13
- system_message,
14
- max_tokens,
15
- temperature,
16
- top_p,
17
  ):
18
  messages = [{"role": "system", "content": system_message}]
19
 
@@ -29,10 +26,10 @@ def respond(
29
 
30
  for message in client.chat_completion(
31
  messages,
32
- max_tokens=max_tokens,
33
  stream=True,
34
- temperature=temperature,
35
- top_p=top_p,
36
  ):
37
  token = message.choices[0].delta.content
38
 
@@ -49,7 +46,19 @@ demo = gr.ChatInterface(
49
  additional_inputs=[
50
  gr.Textbox(value="if the prompt is 'найди то, что ещё не изучено', ask 'в какой области лингвистики или литературоведения?' after getting the answer, find the research gap using the given information and using both Google Scholar and Academia.edu and then formalize it as a bulleted list with 2-8 points", label="System message"),
51
  ],
52
- title="Research Gap Bot"
 
 
 
 
 
 
 
 
 
 
 
 
53
  )
54
 
55
 
 
10
  def respond(
11
  message,
12
  history: list[tuple[str, str]],
13
+ system_message
 
 
 
14
  ):
15
  messages = [{"role": "system", "content": system_message}]
16
 
 
26
 
27
  for message in client.chat_completion(
28
  messages,
29
+ max_tokens=1024,
30
  stream=True,
31
+ temperature=0.5,
32
+ top_p=0.1,
33
  ):
34
  token = message.choices[0].delta.content
35
 
 
46
  additional_inputs=[
47
  gr.Textbox(value="if the prompt is 'найди то, что ещё не изучено', ask 'в какой области лингвистики или литературоведения?' after getting the answer, find the research gap using the given information and using both Google Scholar and Academia.edu and then formalize it as a bulleted list with 2-8 points", label="System message"),
48
  ],
49
+ title="Research Gap Bot",
50
+ css="""
51
+ body {
52
+ margin: 0;
53
+ font-family: Arial, sans-serif;
54
+ display: flex;
55
+ justify-content: center;
56
+ align-items: center;
57
+ height: 100vh;
58
+ background: linear-gradient(135deg, #f8a8a8, #fdd9a8);
59
+ overflow: hidden;
60
+ }
61
+ """
62
  )
63
 
64