Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -12,30 +12,24 @@ HFTOKEN = os.environ["HF_TOKEN"]
|
|
12 |
|
13 |
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
# // Reload Twitter widgets
|
32 |
-
# twttr.widgets.load();
|
33 |
-
|
34 |
-
# // Create new tweet
|
35 |
-
|
36 |
-
# };
|
37 |
-
# }
|
38 |
-
# """
|
39 |
|
40 |
def T_on_select(evt: gr.SelectData):
|
41 |
if evt.index[1] == 3:
|
@@ -174,30 +168,30 @@ def qa_summarise(selected_queries, qa_llm_model, text_field, data_df):
|
|
174 |
|
175 |
|
176 |
with gr.Blocks(fill_width=True) as demo:
|
177 |
-
js = """
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
"""
|
201 |
|
202 |
demo.load(None,None,None,js=js)
|
203 |
|
|
|
12 |
|
13 |
|
14 |
|
15 |
+
js = """
|
16 |
+
async () => {
|
17 |
+
// Load Twitter Widgets script
|
18 |
+
const script = document.createElement("script");
|
19 |
+
script.onload = () => console.log("Twitter Widgets.js loaded");
|
20 |
+
script.src = "https://platform.twitter.com/widgets.js";
|
21 |
+
document.head.appendChild(script);
|
22 |
+
|
23 |
+
// Define a global function to reload Twitter widgets
|
24 |
+
globalThis.reloadTwitterWidgets = () => {
|
25 |
+
// Reload Twitter widgets
|
26 |
+
if (window.twttr && twttr.widgets) {
|
27 |
+
twttr.widgets.load();
|
28 |
+
}
|
29 |
|
30 |
+
};
|
31 |
+
}
|
32 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
def T_on_select(evt: gr.SelectData):
|
35 |
if evt.index[1] == 3:
|
|
|
168 |
|
169 |
|
170 |
with gr.Blocks(fill_width=True) as demo:
|
171 |
+
# js = """
|
172 |
+
# async () => {
|
173 |
+
# // Load Twitter Widgets script
|
174 |
+
# const script = document.createElement("script");
|
175 |
+
# script.onload = () => console.log("Twitter Widgets.js loaded");
|
176 |
+
# script.src = "https://platform.twitter.com/widgets.js";
|
177 |
+
# document.head.appendChild(script);
|
178 |
|
179 |
+
# // Define a global function to reload Twitter widgets
|
180 |
+
# globalThis.reloadTwitterWidgets = () => {
|
181 |
+
# // Select the container where tweets are inserted
|
182 |
+
# const tweetContainer = document.getElementById("tweet-container");
|
183 |
|
184 |
+
# if (tweetContainer) {
|
185 |
+
# tweetContainer.innerHTML = ""; // Clear previous tweets
|
186 |
+
# }
|
187 |
|
188 |
+
# // Reload Twitter widgets
|
189 |
+
# if (window.twttr && twttr.widgets) {
|
190 |
+
# twttr.widgets.load();
|
191 |
+
# }
|
192 |
+
# };
|
193 |
+
# }
|
194 |
+
# """
|
195 |
|
196 |
demo.load(None,None,None,js=js)
|
197 |
|