Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -366,28 +366,8 @@ with gr.Blocks(fill_width=True) as demo:
|
|
366 |
|
367 |
|
368 |
|
369 |
-
|
370 |
-
# m_js = """ (x) =>
|
371 |
-
# {
|
372 |
-
# reloadTwitterWidgets();
|
373 |
-
# const tweetContainer = document.getElementById("tweet-container");
|
374 |
-
# tweetContainer.innerHTML = "";
|
375 |
-
# twttr.widgets.createTweet(x,tweetContainer,{theme: 'dark', dnt: true, align: 'center'});
|
376 |
-
# }
|
377 |
-
|
378 |
-
# """
|
379 |
-
|
380 |
-
# m2_js = """ (x) =>
|
381 |
-
# {
|
382 |
-
# reloadTwitterWidgets();
|
383 |
-
# const tweetContainer = document.getElementById("tweet-container2");
|
384 |
-
# tweetContainer.innerHTML = "";
|
385 |
-
# twttr.widgets.createTweet(x,tweetContainer,{theme: 'dark', dnt: true, align: 'center'});
|
386 |
-
# }
|
387 |
-
|
388 |
-
# """
|
389 |
|
390 |
-
|
391 |
{
|
392 |
reloadTwitterWidgets();
|
393 |
const tweetContainer = document.getElementById("<=CONTAINER-NAME=>");
|
@@ -405,7 +385,7 @@ with gr.Blocks(fill_width=True) as demo:
|
|
405 |
)
|
406 |
|
407 |
T_data.select(T_on_select, None, T_tweetID)
|
408 |
-
T_tweetID.change(fn=None, inputs=T_tweetID, outputs=None, js=
|
409 |
|
410 |
@T_data_filter.input(inputs=[T_data_ss_state, T_data_filter], outputs=T_data)
|
411 |
def filter_df(df, filter):
|
@@ -438,7 +418,7 @@ with gr.Blocks(fill_width=True) as demo:
|
|
438 |
outputs=[hsummary, qa_df])
|
439 |
|
440 |
qa_df.select(T_on_select, None, qa_tweetID)
|
441 |
-
qa_tweetID.change(fn=None, inputs=qa_tweetID, outputs=None, js=
|
442 |
|
443 |
|
444 |
# Event listener for single text classification
|
|
|
366 |
|
367 |
|
368 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
|
370 |
+
createEmbedding_js = """ (x) =>
|
371 |
{
|
372 |
reloadTwitterWidgets();
|
373 |
const tweetContainer = document.getElementById("<=CONTAINER-NAME=>");
|
|
|
385 |
)
|
386 |
|
387 |
T_data.select(T_on_select, None, T_tweetID)
|
388 |
+
T_tweetID.change(fn=None, inputs=T_tweetID, outputs=None, js=createEmbedding_js.replace("<=CONTAINER-NAME=>", "tweet-container"))
|
389 |
|
390 |
@T_data_filter.input(inputs=[T_data_ss_state, T_data_filter], outputs=T_data)
|
391 |
def filter_df(df, filter):
|
|
|
418 |
outputs=[hsummary, qa_df])
|
419 |
|
420 |
qa_df.select(T_on_select, None, qa_tweetID)
|
421 |
+
qa_tweetID.change(fn=None, inputs=qa_tweetID, outputs=None, js=createEmbedding_js.replace("<=CONTAINER-NAME=>", "tweet-container2"))
|
422 |
|
423 |
|
424 |
# Event listener for single text classification
|