afrizalha commited on
Commit
2fc268e
1 Parent(s): 532163f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
app.py CHANGED
@@ -9,14 +9,8 @@ client = OpenAI(api_key=api_secret)
9
 
10
  sysint ='Sampean asisten ingkang mangsuli ngangge basa Jawa Krama, sanes Ngoko.'
11
 
12
- def ask(request, temp, topp, mulgen):
13
  request = str(request)
14
-
15
- if mulgen:
16
- iterations = 3
17
- else:
18
- iterations = 1
19
-
20
  results = []
21
  for i in range(iterations):
22
  chat_completion = client.chat.completions.create(
@@ -26,7 +20,7 @@ def ask(request, temp, topp, mulgen):
26
  temperature=temp,
27
  top_p=topp,
28
  max_tokens=700,
29
- model=bigmodel
30
  )
31
  rescount = f'Result {i+1}:\n'
32
  respond = chat_completion.choices[0].message.content
@@ -39,7 +33,7 @@ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app:
39
  gr.Interface(
40
  fn=ask,
41
  inputs=[
42
- gr.Textbox(label="Pitakenan Jawa Krama"),
43
  gr.Slider(label="Temperature",minimum=0,maximum=1,value=.9,step=.05),
44
  gr.Slider(label="Top p",minimum=0,maximum=1,value=.1,step=.05),
45
  gr.Checkbox(label="Generate 3 at once")
@@ -47,6 +41,5 @@ with gr.Blocks(theme='snehilsanyal/scikit-learn') as app:
47
  outputs=gr.Textbox(label="Mangsulan"),
48
  title="Jawa Krama Chatbot Demo",
49
  allow_flagging="never",
50
- description='This is a fine-tuned version of GPT-3.5 Turbo, trained to speak Krama Javanese.\nMangga pitaken. AI puniki optimal kangge sinau/edukasi.\nTuladha: "Terangaken/Jlentrehaken biologi kodok"\n\nPanduan penggunaan:\n- Model ini dilatih untuk menjelaskan suatu konsep untuk penggunaan edukasi\n- Model ini tidak optimal untuk dialog maupun request menulis suatu hal tertentu, misal minta menulis rencana atau outline\n- Model ini belum optimal untuk menjawab pertanyaan dengan penulisan tidak tertata, misal prompt sepanjang 1-2 kata saja')
51
-
52
  app.launch(debug=True, share=True)
 
9
 
10
  sysint ='Sampean asisten ingkang mangsuli ngangge basa Jawa Krama, sanes Ngoko.'
11
 
12
+ def ask(request, temp, topp,):
13
  request = str(request)
 
 
 
 
 
 
14
  results = []
15
  for i in range(iterations):
16
  chat_completion = client.chat.completions.create(
 
20
  temperature=temp,
21
  top_p=topp,
22
  max_tokens=700,
23
+ model=model
24
  )
25
  rescount = f'Result {i+1}:\n'
26
  respond = chat_completion.choices[0].message.content
 
33
  gr.Interface(
34
  fn=ask,
35
  inputs=[
36
+ gr.Textbox(valu='Panjenengan saged nerangaken menapa LLM saged gadhah peranan wigatos babagan pelestarian basa?', label="Pitakenan Jawa Krama"),
37
  gr.Slider(label="Temperature",minimum=0,maximum=1,value=.9,step=.05),
38
  gr.Slider(label="Top p",minimum=0,maximum=1,value=.1,step=.05),
39
  gr.Checkbox(label="Generate 3 at once")
 
41
  outputs=gr.Textbox(label="Mangsulan"),
42
  title="Jawa Krama Chatbot Demo",
43
  allow_flagging="never",
44
+ description='This is a fine-tuned version of GPT-3.5 Turbo, trained to speak Krama Javanese. The model is optimized to respond to educational questions.
 
45
  app.launch(debug=True, share=True)