minko186 commited on
Commit
3460455
·
1 Parent(s): 70d74f0

reduced url content length to comply with grep limit on tokens

Browse files
Files changed (2) hide show
  1. app.py +6 -2
  2. plagiarism.py +1 -1
app.py CHANGED
@@ -219,7 +219,9 @@ def ai_check(text: str, option: str):
219
 
220
 
221
  def generate_prompt(settings: Dict[str, str]) -> str:
222
- content_string = "\n".join(f"{url.strip()}: \n{content.strip()}" for url, content in settings["sources"].items())
 
 
223
 
224
  prompt = f"""
225
  Write a {settings['article_length']} words (around) {settings['format']} on {settings['topic']}.
@@ -253,7 +255,9 @@ def generate_prompt(settings: Dict[str, str]) -> str:
253
 
254
 
255
  def regenerate_prompt(settings: Dict[str, str]) -> str:
256
- content_string = "\n".join(f"{url.strip()}: \n{content.strip()}" for url, content in settings["sources"].items())
 
 
257
 
258
  prompt = f"""
259
  "{settings['generated_article']}"
 
219
 
220
 
221
  def generate_prompt(settings: Dict[str, str]) -> str:
222
+ content_string = "\n".join(
223
+ f"{url.strip()}: \n{content.strip()[:500]}" for url, content in settings["sources"].items()
224
+ )
225
 
226
  prompt = f"""
227
  Write a {settings['article_length']} words (around) {settings['format']} on {settings['topic']}.
 
255
 
256
 
257
  def regenerate_prompt(settings: Dict[str, str]) -> str:
258
+ content_string = "\n".join(
259
+ f"{url.strip()}: \n{content.strip()[:500]}" for url, content in settings["sources"].items()
260
+ )
261
 
262
  prompt = f"""
263
  "{settings['generated_article']}"
plagiarism.py CHANGED
@@ -55,7 +55,7 @@ def google_search_urls(
55
  **kwargs,
56
  ):
57
  service = build("customsearch", "v1", developerKey=api_key)
58
- num_pages = 5
59
  results = service.cse().list(q=text, cx=cse_id, sort=sorted_date, **kwargs).execute()
60
  url_list = []
61
  if "items" in results and len(results["items"]) > 0:
 
55
  **kwargs,
56
  ):
57
  service = build("customsearch", "v1", developerKey=api_key)
58
+ num_pages = 3
59
  results = service.cse().list(q=text, cx=cse_id, sort=sorted_date, **kwargs).execute()
60
  url_list = []
61
  if "items" in results and len(results["items"]) > 0: