ldhldh commited on
Commit
4287daf
β€’
1 Parent(s): 63c8167

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -34,7 +34,24 @@ def chat(x):
34
 
35
  print("\n___________________\n" + f"{x}")
36
 
37
- output = "Hello?"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  return output
39
 
40
  with gr.Blocks() as demo:
 
34
 
35
  print("\n___________________\n" + f"{x}")
36
 
37
+ result = gradio_client.predict(
38
+ x,
39
+ # str representing input in 'User input' Textbox component
40
+ 0.91, # float, representing input in 'Top-p (nucleus sampling)' Slider component
41
+ 10, # int, representing input in 'Top-k (nucleus sampling)' Slider component
42
+ 0.65, # float, representing input in 'Temperature' Slider component
43
+ 20, # int, representing input in 'Max New Tokens' Slider component
44
+ 1.2, # float, representing input in 'repetition_penalty' Slider component
45
+ fn_index=0
46
+ )
47
+ result = str(result)
48
+ output = result[len(x.rsplit(':', 1)[0])+2:]
49
+ output = re.sub('ν•˜ν•˜','γ…Žγ…Ž', output)
50
+ output = output.split('띓')[0]
51
+ output = output.split('endoftext')[0]
52
+ output = re.sub('[=+#/\:@*\"β€»γ†γ€β€˜|\\\<\>\(\)\[\]`\'…》\”\β€œ\’·]', '', output)
53
+ #output = re.sub('[a-zA-Z]',' ',output)
54
+
55
  return output
56
 
57
  with gr.Blocks() as demo: