Dede16 commited on
Commit
03d3e41
·
1 Parent(s): a9bb489

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -488,18 +488,12 @@ def artikel_processing(source_type,source,backlink,keyword,models,api_key,azure_
488
  os.remove(tmp_path)
489
  except:
490
  image = Image.open('botika_logo.jpeg')
491
-
492
- return judul,content,image,image_data,url
493
-
494
- def scrap(source_type,source,backlink,keyword,version,api_key,azure_api_base,replicate_key):
495
- # try:
496
- judul,kontent,gambar,image_data,url= artikel_processing(source_type,source,backlink,keyword,version,api_key,azure_api_base,replicate_key)
497
 
498
  with open("judul.txt", "w") as file:
499
  file.write(judul)
500
 
501
  with open("kontent.txt", "w") as file:
502
- file.write(kontent)
503
 
504
  repo_name = get_full_repo_name(model_id="Article_Gen4", token="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")
505
  file_url = upload_file(
@@ -540,8 +534,14 @@ def scrap(source_type,source,backlink,keyword,version,api_key,azure_api_base,rep
540
  repo_type="space",
541
  token="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",
542
  )
 
 
 
 
 
 
543
  status = "<h3>Berhasil Generate Artikel</h3>"
544
- time.sleep(60)
545
  return status,gambar
546
  # except:
547
  # status = "<h3>Gagal Generate Artikel</h3>"
 
488
  os.remove(tmp_path)
489
  except:
490
  image = Image.open('botika_logo.jpeg')
 
 
 
 
 
 
491
 
492
  with open("judul.txt", "w") as file:
493
  file.write(judul)
494
 
495
  with open("kontent.txt", "w") as file:
496
+ file.write(content)
497
 
498
  repo_name = get_full_repo_name(model_id="Article_Gen4", token="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")
499
  file_url = upload_file(
 
534
  repo_type="space",
535
  token="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",
536
  )
537
+
538
+ return image
539
+
540
+ def scrap(source_type,source,backlink,keyword,version,api_key,azure_api_base,replicate_key):
541
+ # try:
542
+ gambar = artikel_processing(source_type,source,backlink,keyword,version,api_key,azure_api_base,replicate_key)
543
  status = "<h3>Berhasil Generate Artikel</h3>"
544
+ # time.sleep(60)
545
  return status,gambar
546
  # except:
547
  # status = "<h3>Gagal Generate Artikel</h3>"