nicholasKluge
commited on
Commit
·
50a3ebc
1
Parent(s):
1a39464
Update app.py
Browse files
app.py
CHANGED
@@ -101,7 +101,7 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped') as demo:
|
|
101 |
gr.Markdown("""<h1><center>Aira Demo (Português) 🤓💬</h1></center>""")
|
102 |
gr.Markdown(intro)
|
103 |
|
104 |
-
chatbot = gr.Chatbot(label="Aira"
|
105 |
msg = gr.Textbox(label="Escreva uma pergunta ou instrução para Aira ...", placeholder="Olá Aira, como vai você?")
|
106 |
|
107 |
# Parameters to control the generation
|
@@ -127,9 +127,8 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped') as demo:
|
|
127 |
out_dataframe = gr.Dataframe(
|
128 |
headers=df.columns.tolist(),
|
129 |
datatype=["str", "str", "str"],
|
130 |
-
|
131 |
col_count=(3, "fixed"),
|
132 |
-
overflow_row_behaviour='paginate',
|
133 |
wrap=True,
|
134 |
interactive=False
|
135 |
)
|
@@ -225,14 +224,14 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped') as demo:
|
|
225 |
cosine_similarities = cosine_similarity(prompt_tfidf_matrix, search_vector)
|
226 |
temp_df['Cosine Similarity'] = cosine_similarities
|
227 |
temp_df.sort_values('Cosine Similarity', ascending=False, inplace=True)
|
228 |
-
return temp_df.head()
|
229 |
|
230 |
elif column_name == 'Completion':
|
231 |
search_vector = completion_tfidf_vectorizer.transform([search_string])
|
232 |
cosine_similarities = cosine_similarity(completion_tfidf_matrix, search_vector)
|
233 |
temp_df['Cosine Similarity'] = cosine_similarities
|
234 |
temp_df.sort_values('Cosine Similarity', ascending=False, inplace=True)
|
235 |
-
return temp_df.head()
|
236 |
|
237 |
|
238 |
|
@@ -245,4 +244,4 @@ with gr.Blocks(theme='freddyaboulton/dracula_revamped') as demo:
|
|
245 |
submit.click(fn=search_in_datset, inputs=[search_field, search_input], outputs=out_dataframe)
|
246 |
|
247 |
demo.queue()
|
248 |
-
demo.launch()
|
|
|
101 |
gr.Markdown("""<h1><center>Aira Demo (Português) 🤓💬</h1></center>""")
|
102 |
gr.Markdown(intro)
|
103 |
|
104 |
+
chatbot = gr.Chatbot(label="Aira", height=500)
|
105 |
msg = gr.Textbox(label="Escreva uma pergunta ou instrução para Aira ...", placeholder="Olá Aira, como vai você?")
|
106 |
|
107 |
# Parameters to control the generation
|
|
|
127 |
out_dataframe = gr.Dataframe(
|
128 |
headers=df.columns.tolist(),
|
129 |
datatype=["str", "str", "str"],
|
130 |
+
row_count=10,
|
131 |
col_count=(3, "fixed"),
|
|
|
132 |
wrap=True,
|
133 |
interactive=False
|
134 |
)
|
|
|
224 |
cosine_similarities = cosine_similarity(prompt_tfidf_matrix, search_vector)
|
225 |
temp_df['Cosine Similarity'] = cosine_similarities
|
226 |
temp_df.sort_values('Cosine Similarity', ascending=False, inplace=True)
|
227 |
+
return temp_df.head(10)
|
228 |
|
229 |
elif column_name == 'Completion':
|
230 |
search_vector = completion_tfidf_vectorizer.transform([search_string])
|
231 |
cosine_similarities = cosine_similarity(completion_tfidf_matrix, search_vector)
|
232 |
temp_df['Cosine Similarity'] = cosine_similarities
|
233 |
temp_df.sort_values('Cosine Similarity', ascending=False, inplace=True)
|
234 |
+
return temp_df.head(10)
|
235 |
|
236 |
|
237 |
|
|
|
244 |
submit.click(fn=search_in_datset, inputs=[search_field, search_input], outputs=out_dataframe)
|
245 |
|
246 |
demo.queue()
|
247 |
+
demo.launch()
|