Commit
•
81667a5
1
Parent(s):
e98343d
Update app.py
Browse files
app.py
CHANGED
@@ -80,10 +80,10 @@ class OpenAI:
|
|
80 |
content = result["choices"][0]["message"]["content"].strip()
|
81 |
return content
|
82 |
|
83 |
-
class
|
84 |
|
85 |
@classmethod
|
86 |
-
def
|
87 |
template = get_filetext(filename="template.md")
|
88 |
prompt = f"""
|
89 |
{user_message}
|
@@ -95,14 +95,14 @@ class MasasanAI:
|
|
95 |
return prompt
|
96 |
|
97 |
@classmethod
|
98 |
-
def
|
99 |
-
prompt =
|
100 |
start_with = ""
|
101 |
result = OpenAI.chat_completion(prompt=prompt, start_with=start_with)
|
102 |
return result
|
103 |
|
104 |
def main():
|
105 |
-
iface = gr.Interface(fn=
|
106 |
inputs=gr.Textbox(label=inputs_label),
|
107 |
outputs=gr.Textbox(label=outputs_label),
|
108 |
title=title,
|
|
|
80 |
content = result["choices"][0]["message"]["content"].strip()
|
81 |
return content
|
82 |
|
83 |
+
class NajiminoAI:
|
84 |
|
85 |
@classmethod
|
86 |
+
def generate_emo_prompt(cls, user_message):
|
87 |
template = get_filetext(filename="template.md")
|
88 |
prompt = f"""
|
89 |
{user_message}
|
|
|
95 |
return prompt
|
96 |
|
97 |
@classmethod
|
98 |
+
def generate_emo(cls, user_message):
|
99 |
+
prompt = NajiminoAI.generate_emo_prompt(user_message);
|
100 |
start_with = ""
|
101 |
result = OpenAI.chat_completion(prompt=prompt, start_with=start_with)
|
102 |
return result
|
103 |
|
104 |
def main():
|
105 |
+
iface = gr.Interface(fn=NajiminoAI.generate_emo,
|
106 |
inputs=gr.Textbox(label=inputs_label),
|
107 |
outputs=gr.Textbox(label=outputs_label),
|
108 |
title=title,
|