Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,28 @@ from sentence_transformers import SentenceTransformer, util
|
|
3 |
import openai
|
4 |
import os
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
7 |
|
8 |
# Initialize paths and model identifiers for easy configuration and maintenance
|
|
|
3 |
import openai
|
4 |
import os
|
5 |
|
6 |
+
# potential color customization
|
7 |
+
|
8 |
+
import gradio as gr
|
9 |
+
from transformers import pipeline
|
10 |
+
|
11 |
+
# Load the Hugging Face pipeline
|
12 |
+
summarizer = pipeline("summarization")
|
13 |
+
|
14 |
+
# Define the function to be used in the Gradio interface
|
15 |
+
def summarize_text(text):
|
16 |
+
summary = summarizer(text)[0]['summary_text']
|
17 |
+
return summary
|
18 |
+
|
19 |
+
# Define custom CSS
|
20 |
+
custom_css = """
|
21 |
+
body {
|
22 |
+
background-color: #a9e3cb;
|
23 |
+
}
|
24 |
+
.gradio-title {
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
os.environ["TOKENIZERS_PARALLELISM"] = "false"
|
29 |
|
30 |
# Initialize paths and model identifiers for easy configuration and maintenance
|