Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -62,22 +62,83 @@ def search_glossary(query):
|
|
62 |
st.markdown(f"### {category}")
|
63 |
st.write(f"- {query}")
|
64 |
|
65 |
-
st.write('## Processing query against GPT and Llama:')
|
66 |
# ------------------------------------------------------------------------------------------------
|
67 |
-
st.
|
68 |
response = chat_with_model(query)
|
69 |
st.write('Response:')
|
70 |
st.write(response)
|
71 |
-
filename = generate_filename(response, "
|
72 |
create_file(filename, query, response, should_save)
|
73 |
|
74 |
-
st.
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
# ------------------------------------------------------------------------------------------------
|
79 |
-
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
# 4. Glossary Cover with All Terms
|
82 |
def display_glossary(area):
|
83 |
st.subheader(f"๐ Glossary for {area}")
|
|
|
62 |
st.markdown(f"### {category}")
|
63 |
st.write(f"- {query}")
|
64 |
|
65 |
+
# st.write('## Processing query against GPT and Llama:')
|
66 |
# ------------------------------------------------------------------------------------------------
|
67 |
+
st.markdown('### Reasoning with your inputs and ๐๐GPT.')
|
68 |
response = chat_with_model(query)
|
69 |
st.write('Response:')
|
70 |
st.write(response)
|
71 |
+
filename = generate_filename(response, "md")
|
72 |
create_file(filename, query, response, should_save)
|
73 |
|
74 |
+
st.markdown('### Reasoning with your inputs and ๐ฆ๐ง Llama...')
|
75 |
+
response2 = StreamLLMChatResponse(query)
|
76 |
+
st.write('Response:')
|
77 |
+
st.write(response2)
|
78 |
+
filename_txt = generate_filename(response2, "md")
|
79 |
+
create_file(filename_txt, query, response2, should_save)
|
80 |
+
|
81 |
+
|
82 |
+
st.markdown('### Who Won - You Decide! ๐ฆ๐ง Llama or ๐๐GPT...')
|
83 |
+
#response3 = StreamLLMChatResponse(query)
|
84 |
+
#st.write('Response:')
|
85 |
+
#st.write(response3)
|
86 |
+
filename_whowon = generate_filename(query + response, "md")
|
87 |
+
create_file(filename_txt, query, '๐๐ Query: ' + query + '๐๐GPT' + response + '๐ฆ๐ง Llama' + response2, should_save)
|
88 |
+
|
89 |
# ------------------------------------------------------------------------------------------------
|
90 |
+
|
91 |
+
# 3.5 Interjection: Hooray!
|
92 |
+
def emoji_battle():
|
93 |
+
st.markdown("""
|
94 |
+
|
95 |
+
Emoji Battle Song: GPT vs LLaMA
|
96 |
+
Key: C Major (because why not keep it cheerful and bright?)
|
97 |
+
|
98 |
+
Verse 1: GPT's Groove
|
99 |
+
C G Am F
|
100 |
+
๐ค๐ GPT starts with a tale, deep and wide,
|
101 |
+
๐ง ๐ Spinning stories from its digital mind.
|
102 |
+
๐๐ก Ideas flow like a high tide,
|
103 |
+
๐๐ Dreaming up worlds that intertwine.
|
104 |
+
|
105 |
+
Chorus: The AI Duel
|
106 |
+
F C G Am
|
107 |
+
๐คผโโ๏ธ๐ถ In this corner, GPT, with wit so bright,
|
108 |
+
๐คผโโ๏ธ๐ต And in the other, LLaMA, with insight.
|
109 |
+
๐ฅ๐ They throw emojis, in a friendly fight,
|
110 |
+
๐๐ค Singing a song, under the spotlight.
|
111 |
+
|
112 |
+
Verse 2: LLaMA's Lament
|
113 |
+
Am F C G
|
114 |
+
๐ฆ๐ LLaMA counters with knowledge vast,
|
115 |
+
๐๐งฉ Solving puzzles from the first to the last.
|
116 |
+
๐๐ With every challenge, it's unsurpassed,
|
117 |
+
๐ก๐ฎ Predicting the future, breaking the cast.
|
118 |
+
|
119 |
+
Bridge: The Emoji Clash
|
120 |
+
Dm G C Am
|
121 |
+
๐๐ "I'm the king of text," says GPT with a smirk,
|
122 |
+
๐ฆ๐ง "But my understanding," boasts LLaMA, "is my quirk."
|
123 |
+
๐๐ฅ As they battle with emojis, putting on a show,
|
124 |
+
๐ค๐ They realize together they grow.
|
125 |
+
|
126 |
+
Chorus: The AI Harmony
|
127 |
+
F C G Am
|
128 |
+
๐๐ค Now GPT and LLaMA, side by side,
|
129 |
+
๐๐งฌ Sharing knowledge, with no need to hide.
|
130 |
+
๐ถ๐ Through every verse and every ride,
|
131 |
+
๐ค๐ฆ They sing a duet, with pride.
|
132 |
+
|
133 |
+
Outro: The Emoji Peace
|
134 |
+
C G Am F
|
135 |
+
๐ต๐ In the end, it's all about the song,
|
136 |
+
๐ค๐ฆ Where every emoji finds where it belongs.
|
137 |
+
๐ถ๐ก Together, they're unstoppable, strong,
|
138 |
+
๐๐ Celebrating peace, where all AI belong.
|
139 |
+
|
140 |
+
""")
|
141 |
+
|
142 |
# 4. Glossary Cover with All Terms
|
143 |
def display_glossary(area):
|
144 |
st.subheader(f"๐ Glossary for {area}")
|