Spaces:
Build error
Build error
Commit
·
513383b
verified
·
0
Parent(s):
initial commit
Browse files- .gitattributes +35 -0
- README.md +13 -0
- app.py +68 -0
- requirements.txt +5 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Etest
|
| 3 |
+
emoji: 👁
|
| 4 |
+
colorFrom: gray
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 5.5.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
short_description: test
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# This Gradio app creates a responsive newsletter for https://theendthebook.com
|
| 2 |
+
# It includes an automated article writer that finds current events aligning with biblical prophecies,
|
| 3 |
+
# rewrites the article, checks for plagiarism, and schedules updates every week at 12 am EST Monday.
|
| 4 |
+
|
| 5 |
+
import gradio as gr
|
| 6 |
+
import numpy as np
|
| 7 |
+
import pandas as pd
|
| 8 |
+
import matplotlib.pyplot as plt
|
| 9 |
+
import transformers_js
|
| 10 |
+
import datetime
|
| 11 |
+
import pytz
|
| 12 |
+
|
| 13 |
+
# Define the function to find and rewrite articles
|
| 14 |
+
def find_and_rewrite_article():
|
| 15 |
+
# Placeholder for finding and rewriting articles
|
| 16 |
+
# This would involve web scraping, NLP, and rewriting logic
|
| 17 |
+
# For demonstration, we return a sample article
|
| 18 |
+
article = {
|
| 19 |
+
"title": "Current Event Aligning with Biblical Prophecy",
|
| 20 |
+
"content": "This is a sample article about a current event that aligns with biblical prophecies. The article is rewritten to ensure it is unique and not plagiarized."
|
| 21 |
+
}
|
| 22 |
+
return article
|
| 23 |
+
|
| 24 |
+
# Define the function to check for plagiarism
|
| 25 |
+
def check_plagiarism(article):
|
| 26 |
+
# Placeholder for plagiarism checking
|
| 27 |
+
# This would involve comparing the article to existing content using NLP techniques
|
| 28 |
+
# For demonstration, we assume the article is not plagiarized
|
| 29 |
+
return "No plagiarism detected"
|
| 30 |
+
|
| 31 |
+
# Define the function to schedule updates
|
| 32 |
+
def schedule_updates():
|
| 33 |
+
# Schedule updates every week at 12 am EST Monday
|
| 34 |
+
est = pytz.timezone('US/Eastern')
|
| 35 |
+
now = datetime.datetime.now(est)
|
| 36 |
+
next_monday = now + datetime.timedelta(days=(7 - now.weekday()))
|
| 37 |
+
next_monday = next_monday.replace(hour=0, minute=0, second=0, microsecond=0)
|
| 38 |
+
time_to_next_monday = (next_monday - now).total_seconds()
|
| 39 |
+
return time_to_next_monday
|
| 40 |
+
|
| 41 |
+
# Define the main function to generate the newsletter
|
| 42 |
+
def generate_newsletter():
|
| 43 |
+
article = find_and_rewrite_article()
|
| 44 |
+
plagiarism_check = check_plagiarism(article)
|
| 45 |
+
return article["title"], article["content"], plagiarism_check
|
| 46 |
+
|
| 47 |
+
# Create the Gradio app
|
| 48 |
+
with gr.Blocks() as demo:
|
| 49 |
+
# Define the layout using a bento box layout
|
| 50 |
+
with gr.Row():
|
| 51 |
+
with gr.Column(scale=1):
|
| 52 |
+
gr.Markdown("# The End - The Book of Revelation Newsletter")
|
| 53 |
+
gr.Markdown("## Current Event Aligning with Biblical Prophecy")
|
| 54 |
+
title = gr.Textbox(label="Article Title", interactive=False)
|
| 55 |
+
content = gr.Textbox(label="Article Content", interactive=False, lines=10)
|
| 56 |
+
plagiarism_check = gr.Textbox(label="Plagiarism Check", interactive=False)
|
| 57 |
+
generate_btn = gr.Button("Generate Newsletter")
|
| 58 |
+
|
| 59 |
+
# Define the event listener for the generate button
|
| 60 |
+
generate_btn.click(generate_newsletter, outputs=[title, content, plagiarism_check])
|
| 61 |
+
|
| 62 |
+
# Schedule updates
|
| 63 |
+
time_to_next_monday = schedule_updates()
|
| 64 |
+
timer = gr.Timer(time_to_next_monday, active=True)
|
| 65 |
+
timer.tick(generate_newsletter, outputs=[title, content, plagiarism_check])
|
| 66 |
+
|
| 67 |
+
# Launch the app
|
| 68 |
+
demo.launch(show_error=True)
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
numpy
|
| 2 |
+
pandas
|
| 3 |
+
matplotlib
|
| 4 |
+
transformers-js
|
| 5 |
+
pytz
|