taesiri commited on
Commit
9f62051
1 Parent(s): fcda419

fix markdown parsing

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -5,17 +5,15 @@ import tarfile
5
 
6
  import anthropic
7
  import gradio as gr
8
- import matplotlib.pyplot as plt
9
- import numpy as np
10
- import openai
11
- import pandas as pd
12
  import requests
13
- import seaborn as sns
14
- from tqdm import tqdm
15
 
16
  import arxiv
17
 
18
 
 
 
 
 
19
  def get_paper_info(paper_id):
20
  # Create a search query with the arXiv ID
21
  search = arxiv.Search(id_list=[paper_id])
@@ -132,6 +130,9 @@ def load_context(paper_id):
132
 
133
  # Usage
134
  title, abstract = get_paper_info(paper_id)
 
 
 
135
 
136
  return (
137
  model,
 
5
 
6
  import anthropic
7
  import gradio as gr
 
 
 
 
8
  import requests
 
 
9
 
10
  import arxiv
11
 
12
 
13
+ def replace_texttt(text):
14
+ return re.sub(r"\\texttt\{(.*?)\}", r"*\1*", text)
15
+
16
+
17
  def get_paper_info(paper_id):
18
  # Create a search query with the arXiv ID
19
  search = arxiv.Search(id_list=[paper_id])
 
130
 
131
  # Usage
132
  title, abstract = get_paper_info(paper_id)
133
+ # remove special symbols from title and abstract
134
+ title = replace_texttt(title)
135
+ abstract = replace_texttt(abstract)
136
 
137
  return (
138
  model,