awacke1 commited on
Commit
58f8c6d
ยท
verified ยท
1 Parent(s): 80031ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +70 -9
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.write('Reasoning with your inputs using GPT...')
68
  response = chat_with_model(query)
69
  st.write('Response:')
70
  st.write(response)
71
- filename = generate_filename(response, "txt")
72
  create_file(filename, query, response, should_save)
73
 
74
- st.write('Reasoning with your inputs using Llama...')
75
- response = StreamLLMChatResponse(query)
76
- filename_txt = generate_filename(query, "md")
77
- create_file(filename_txt, query, response, should_save)
 
 
 
 
 
 
 
 
 
 
 
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}")