EliottZemour commited on
Commit
80d71cb
1 Parent(s): e426ea3
Files changed (2) hide show
  1. app.py +3 -38
  2. htmlgen.ipynb +30 -8
app.py CHANGED
@@ -35,58 +35,23 @@ card_template = CARDS_TEMPLATE(
35
  )
36
 
37
  CSS = """
38
- #question input {
39
- font-size: 16px;
40
- }
41
  #url-textbox {
42
  padding: 0 !important;
 
43
  }
44
- #file-clear {
45
- padding-top: 2px !important;
46
- padding-bottom: 2px !important;
47
- padding-left: 8px !important;
48
- padding-right: 8px !important;
49
- margin-top: 10px;
50
- }
51
  .gradio-container .gr-button-primary {
52
  background: #b31b1b;
53
  border: 1px solid #b31b1b;
54
  border-radius: 8px;
55
  color: white;
56
  font-weight: bold;
57
- }
58
-
59
- gradio-app > div > div > div > div.w-full > div, .gradio-app > div > div > div > div.w-full > div {
60
- gap: 0px 2%;
61
- }
62
- gradio-app div div div div.w-full, .gradio-app div div div div.w-full {
63
- gap: 0px;
64
  }
65
 
66
  #htel {
67
  justify-content: center;
68
  }
69
-
70
- #answer {
71
- overflow-y: scroll;
72
- color: white;
73
- background: #666;
74
- border-color: #666;
75
- font-size: 20px;
76
- font-weight: bold;
77
- }
78
- #answer span {
79
- color: white;
80
- }
81
- #answer textarea {
82
- color:white;
83
- background: #777;
84
- border-color: #777;
85
- font-size: 18px;
86
- }
87
- #url-error input {
88
- color: red;
89
- }
90
  """
91
 
92
  def create_html_card(arxiv_link):
 
35
  )
36
 
37
  CSS = """
 
 
 
38
  #url-textbox {
39
  padding: 0 !important;
40
+ font-size: 16px;
41
  }
42
+
 
 
 
 
 
 
43
  .gradio-container .gr-button-primary {
44
  background: #b31b1b;
45
  border: 1px solid #b31b1b;
46
  border-radius: 8px;
47
  color: white;
48
  font-weight: bold;
49
+ font-size: 16px;
 
 
 
 
 
 
50
  }
51
 
52
  #htel {
53
  justify-content: center;
54
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  """
56
 
57
  def create_html_card(arxiv_link):
htmlgen.ipynb CHANGED
@@ -194,7 +194,7 @@
194
  },
195
  {
196
  "cell_type": "code",
197
- "execution_count": 94,
198
  "metadata": {},
199
  "outputs": [],
200
  "source": [
@@ -361,7 +361,7 @@
361
  },
362
  {
363
  "cell_type": "code",
364
- "execution_count": 11,
365
  "metadata": {},
366
  "outputs": [],
367
  "source": [
@@ -384,7 +384,7 @@
384
  },
385
  {
386
  "cell_type": "code",
387
- "execution_count": 29,
388
  "metadata": {},
389
  "outputs": [],
390
  "source": [
@@ -455,14 +455,14 @@
455
  },
456
  {
457
  "cell_type": "code",
458
- "execution_count": 30,
459
  "metadata": {},
460
  "outputs": [
461
  {
462
  "name": "stdout",
463
  "output_type": "stream",
464
  "text": [
465
- "Running on local URL: http://127.0.0.1:7872/\n",
466
  "\n",
467
  "To create a public link, set `share=True` in `launch()`.\n"
468
  ]
@@ -470,7 +470,7 @@
470
  {
471
  "data": {
472
  "text/html": [
473
- "<div><iframe src=\"http://127.0.0.1:7872/\" width=\"900\" height=\"500\" allow=\"autoplay; camera; microphone;\" frameborder=\"0\" allowfullscreen></iframe></div>"
474
  ],
475
  "text/plain": [
476
  "<IPython.core.display.HTML object>"
@@ -482,12 +482,34 @@
482
  {
483
  "data": {
484
  "text/plain": [
485
- "(<gradio.routes.App at 0x157d354e0>, 'http://127.0.0.1:7872/', None)"
486
  ]
487
  },
488
- "execution_count": 30,
489
  "metadata": {},
490
  "output_type": "execute_result"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
491
  }
492
  ],
493
  "source": [
 
194
  },
195
  {
196
  "cell_type": "code",
197
+ "execution_count": 34,
198
  "metadata": {},
199
  "outputs": [],
200
  "source": [
 
361
  },
362
  {
363
  "cell_type": "code",
364
+ "execution_count": 35,
365
  "metadata": {},
366
  "outputs": [],
367
  "source": [
 
384
  },
385
  {
386
  "cell_type": "code",
387
+ "execution_count": 32,
388
  "metadata": {},
389
  "outputs": [],
390
  "source": [
 
455
  },
456
  {
457
  "cell_type": "code",
458
+ "execution_count": 33,
459
  "metadata": {},
460
  "outputs": [
461
  {
462
  "name": "stdout",
463
  "output_type": "stream",
464
  "text": [
465
+ "Running on local URL: http://127.0.0.1:7874/\n",
466
  "\n",
467
  "To create a public link, set `share=True` in `launch()`.\n"
468
  ]
 
470
  {
471
  "data": {
472
  "text/html": [
473
+ "<div><iframe src=\"http://127.0.0.1:7874/\" width=\"900\" height=\"500\" allow=\"autoplay; camera; microphone;\" frameborder=\"0\" allowfullscreen></iframe></div>"
474
  ],
475
  "text/plain": [
476
  "<IPython.core.display.HTML object>"
 
482
  {
483
  "data": {
484
  "text/plain": [
485
+ "(<gradio.routes.App at 0x157e48fa0>, 'http://127.0.0.1:7874/', None)"
486
  ]
487
  },
488
+ "execution_count": 33,
489
  "metadata": {},
490
  "output_type": "execute_result"
491
+ },
492
+ {
493
+ "name": "stderr",
494
+ "output_type": "stream",
495
+ "text": [
496
+ "Traceback (most recent call last):\n",
497
+ " File \"/Users/eliott/Desktop/arxiv-cards/venv/lib/python3.10/site-packages/gradio/routes.py\", line 259, in run_predict\n",
498
+ " output = await app.blocks.process_api(\n",
499
+ " File \"/Users/eliott/Desktop/arxiv-cards/venv/lib/python3.10/site-packages/gradio/blocks.py\", line 687, in process_api\n",
500
+ " predictions, duration = await self.call_function(fn_index, inputs)\n",
501
+ " File \"/Users/eliott/Desktop/arxiv-cards/venv/lib/python3.10/site-packages/gradio/blocks.py\", line 604, in call_function\n",
502
+ " prediction = await anyio.to_thread.run_sync(\n",
503
+ " File \"/Users/eliott/Desktop/arxiv-cards/venv/lib/python3.10/site-packages/anyio/to_thread.py\", line 31, in run_sync\n",
504
+ " return await get_asynclib().run_sync_in_worker_thread(\n",
505
+ " File \"/Users/eliott/Desktop/arxiv-cards/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py\", line 937, in run_sync_in_worker_thread\n",
506
+ " return await future\n",
507
+ " File \"/Users/eliott/Desktop/arxiv-cards/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py\", line 867, in run\n",
508
+ " result = context.run(func, *args)\n",
509
+ " File \"/var/folders/7k/c2q_b15953b9d0vfdn2h_mv00000gn/T/ipykernel_31384/2614688053.py\", line 4, in text_analysis\n",
510
+ " return html\n",
511
+ "NameError: name 'html' is not defined\n"
512
+ ]
513
  }
514
  ],
515
  "source": [