imseldrith commited on
Commit
373e47b
·
1 Parent(s): 67eb76e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -5,6 +5,9 @@ import random
5
  import time
6
  import textblob
7
  from textblob import TextBlob
 
 
 
8
 
9
  @st.cache
10
  def run_model(input_text):
@@ -32,6 +35,14 @@ def main():
32
  generated_text = run_model(input_text)
33
  st.write("Generated Text:", generated_text)
34
  st.write("Paraphrasing completed!")
 
 
 
 
 
 
 
 
35
 
36
  if __name__ == "__main__":
37
- main()
 
5
  import time
6
  import textblob
7
  from textblob import TextBlob
8
+ from flask import Flask, request
9
+
10
+ app = Flask(__name__)
11
 
12
  @st.cache
13
  def run_model(input_text):
 
35
  generated_text = run_model(input_text)
36
  st.write("Generated Text:", generated_text)
37
  st.write("Paraphrasing completed!")
38
+ st.write("")
39
+ st.write("Click the button below to copy the generated text to your clipboard:")
40
+ st.button("Copy to Clipboard", script="document.execCommand('copy');", key="copy")
41
+
42
+ @app.route("/", methods=["GET", "POST"])
43
+ def index():
44
+ main()
45
+ return st.get_html_str()
46
 
47
  if __name__ == "__main__":
48
+ app.run(host="0.0.0.0",port=7860)