Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -90,12 +90,12 @@ function closefn(inn) {
|
|
90 |
}
|
91 |
</script>
|
92 |
<script>
|
93 |
-
function readfn(inn, url_in) {
|
94 |
let url = String(url_in);
|
95 |
console.log(inn);
|
96 |
console.log(url);
|
97 |
var readit = document.getElementById('aud' + String(inn));
|
98 |
-
let api = 'https://broadfield-fast-voice.hf.space/?pdfurl=' + url;
|
99 |
console.log(api);
|
100 |
let child = readit.lastElementChild;
|
101 |
while (child) {
|
@@ -106,13 +106,20 @@ function readfn(inn, url_in) {
|
|
106 |
|
107 |
iframe.src = api;
|
108 |
iframe.width = '100%';
|
109 |
-
iframe.height = '
|
110 |
readit.appendChild(iframe);
|
111 |
}
|
112 |
</script>
|
113 |
"""
|
114 |
|
115 |
def search(q,rn,st):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
api=f"http://export.arxiv.org/api/query?search_query={str(q)}&start={str(st)}&max_results={str(rn)}"
|
117 |
r=requests.get(api)
|
118 |
cont=xmltodict.parse(r.content)['feed']['entry']
|
@@ -120,7 +127,7 @@ def search(q,rn,st):
|
|
120 |
for i,c in enumerate(cont):
|
121 |
pdflink=c['id'].replace('/abs/','/pdf/').replace('http:','https:')
|
122 |
print(pdflink)
|
123 |
-
html+=f"""<div class='card_div' id='id{i}' onclick="run('{i}','{pdflink}')">
|
124 |
<div class='title_div'>{c['title']}</div>
|
125 |
<div style='color:white;'>{c['summary']}</div>
|
126 |
<div><a href='{pdflink}' target='_blank'>{pdflink}</a></div>
|
|
|
90 |
}
|
91 |
</script>
|
92 |
<script>
|
93 |
+
function readfn(inn, url_in, payload) {
|
94 |
let url = String(url_in);
|
95 |
console.log(inn);
|
96 |
console.log(url);
|
97 |
var readit = document.getElementById('aud' + String(inn));
|
98 |
+
let api = 'https://broadfield-fast-voice.hf.space/?pdfurl=' + url + '&mod=' + payload['model'];
|
99 |
console.log(api);
|
100 |
let child = readit.lastElementChild;
|
101 |
while (child) {
|
|
|
106 |
|
107 |
iframe.src = api;
|
108 |
iframe.width = '100%';
|
109 |
+
iframe.height = '220px';
|
110 |
readit.appendChild(iframe);
|
111 |
}
|
112 |
</script>
|
113 |
"""
|
114 |
|
115 |
def search(q,rn,st):
|
116 |
+
payload={
|
117 |
+
"model": "en_US-norman-medium",
|
118 |
+
"length": 1,
|
119 |
+
"noise": 0.5,
|
120 |
+
"width": 0.2,
|
121 |
+
"pause": 1
|
122 |
+
}
|
123 |
api=f"http://export.arxiv.org/api/query?search_query={str(q)}&start={str(st)}&max_results={str(rn)}"
|
124 |
r=requests.get(api)
|
125 |
cont=xmltodict.parse(r.content)['feed']['entry']
|
|
|
127 |
for i,c in enumerate(cont):
|
128 |
pdflink=c['id'].replace('/abs/','/pdf/').replace('http:','https:')
|
129 |
print(pdflink)
|
130 |
+
html+=f"""<div class='card_div' id='id{i}' onclick="run('{i}','{pdflink}',{payload})">
|
131 |
<div class='title_div'>{c['title']}</div>
|
132 |
<div style='color:white;'>{c['summary']}</div>
|
133 |
<div><a href='{pdflink}' target='_blank'>{pdflink}</a></div>
|