Update app.py
Browse files
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,
|
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=
|
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
|
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)
|