Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import base64
|
|
6 |
text_generator = pipeline("text-generation", model="Shruti9756/G24_Contract_Summarization_step3")
|
7 |
|
8 |
# Increase the maximum token limit
|
9 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
10 |
text_generator.model.config.max_position_embeddings = tokenizer.model_max_length
|
11 |
|
12 |
# Function to generate text using the GPT-2 model
|
@@ -14,13 +14,13 @@ def generate_text(prompt):
|
|
14 |
generated_text = text_generator(prompt, max_length=300, num_return_sequences=1, temperature=0.7)[0]['generated_text']
|
15 |
return generated_text
|
16 |
|
17 |
-
# Function to handle feedback and store it in a CSV file
|
18 |
-
def handle_feedback(feedback_data, feedback_file):
|
19 |
-
|
20 |
|
21 |
-
# Function to create a download link for a binary file
|
22 |
-
def get_binary_file_downloader_html(file_path, file_label):
|
23 |
-
|
24 |
|
25 |
# Main Streamlit app
|
26 |
def main():
|
|
|
6 |
text_generator = pipeline("text-generation", model="Shruti9756/G24_Contract_Summarization_step3")
|
7 |
|
8 |
# Increase the maximum token limit
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained("Shruti9756/G24_Contract_Summarization_step3")
|
10 |
text_generator.model.config.max_position_embeddings = tokenizer.model_max_length
|
11 |
|
12 |
# Function to generate text using the GPT-2 model
|
|
|
14 |
generated_text = text_generator(prompt, max_length=300, num_return_sequences=1, temperature=0.7)[0]['generated_text']
|
15 |
return generated_text
|
16 |
|
17 |
+
# # Function to handle feedback and store it in a CSV file
|
18 |
+
# def handle_feedback(feedback_data, feedback_file):
|
19 |
+
# # Your existing feedback handling logic remains the same
|
20 |
|
21 |
+
# # Function to create a download link for a binary file
|
22 |
+
# def get_binary_file_downloader_html(file_path, file_label):
|
23 |
+
# # Your existing file downloader logic remains the same
|
24 |
|
25 |
# Main Streamlit app
|
26 |
def main():
|