Spaces:
Runtime error
Runtime error
peter szemraj
commited on
Commit
·
39f9011
1
Parent(s):
0601dad
change default prompt, add postprocessing
Browse files
app.py
CHANGED
|
@@ -5,6 +5,8 @@ import gradio as gr
|
|
| 5 |
import torch
|
| 6 |
from transformers import pipeline
|
| 7 |
|
|
|
|
|
|
|
| 8 |
logging.basicConfig(
|
| 9 |
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
|
| 10 |
)
|
|
@@ -62,7 +64,7 @@ def generate_text(
|
|
| 62 |
if verbose:
|
| 63 |
logging.info(f"Generated text: {response}")
|
| 64 |
logging.info(f"Generation time: {rt:.2f}s")
|
| 65 |
-
return response
|
| 66 |
|
| 67 |
|
| 68 |
def get_parser():
|
|
@@ -95,7 +97,7 @@ def get_parser():
|
|
| 95 |
default_prompt = """
|
| 96 |
Hello,
|
| 97 |
|
| 98 |
-
|
| 99 |
|
| 100 |
if __name__ == "__main__":
|
| 101 |
logging.info("\n\n\nStarting new instance of app.py")
|
|
|
|
| 5 |
import torch
|
| 6 |
from transformers import pipeline
|
| 7 |
|
| 8 |
+
from utils import postprocess
|
| 9 |
+
|
| 10 |
logging.basicConfig(
|
| 11 |
level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s"
|
| 12 |
)
|
|
|
|
| 64 |
if verbose:
|
| 65 |
logging.info(f"Generated text: {response}")
|
| 66 |
logging.info(f"Generation time: {rt:.2f}s")
|
| 67 |
+
return postprocess(response)
|
| 68 |
|
| 69 |
|
| 70 |
def get_parser():
|
|
|
|
| 97 |
default_prompt = """
|
| 98 |
Hello,
|
| 99 |
|
| 100 |
+
Got this in my personal email, might be very useful as a "real" platform for a hackathon. Let"""
|
| 101 |
|
| 102 |
if __name__ == "__main__":
|
| 103 |
logging.info("\n\n\nStarting new instance of app.py")
|