Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
from fpdf import FPDF
|
4 |
-
import pdfplumber
|
5 |
import os
|
6 |
import time
|
7 |
|
@@ -108,23 +107,18 @@ def main():
|
|
108 |
st.markdown("**Team Name:** Sadia, Areeba, Rabbia, Tesmia")
|
109 |
st.markdown("**LLM Model:** Mistral")
|
110 |
|
111 |
-
# Input
|
112 |
st.markdown("### Enter Requirements")
|
113 |
-
|
114 |
-
#input_option = "Enter Requirements"
|
115 |
-
|
116 |
requirements = []
|
117 |
-
|
118 |
-
|
119 |
-
if
|
120 |
-
# Split by periods or newlines
|
121 |
-
requirements = [req.strip() for req in input_text.replace("\n", ".").split(".") if req.strip()]
|
122 |
-
|
123 |
|
124 |
# Analyze requirements
|
125 |
if st.button("Analyze Requirements"):
|
126 |
if not requirements:
|
127 |
-
st.warning("Please enter
|
128 |
else:
|
129 |
results = []
|
130 |
for req in requirements:
|
@@ -142,8 +136,6 @@ def main():
|
|
142 |
st.write(f"**Rewritten:** {result['Rewritten']}")
|
143 |
st.write("---")
|
144 |
|
145 |
-
|
146 |
-
|
147 |
# Generate and download PDF report
|
148 |
pdf_report = generate_pdf_report(results)
|
149 |
with open(pdf_report, "rb") as f:
|
@@ -156,4 +148,4 @@ def main():
|
|
156 |
|
157 |
# Run the app
|
158 |
if __name__ == "__main__":
|
159 |
-
main()
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
from fpdf import FPDF
|
|
|
4 |
import os
|
5 |
import time
|
6 |
|
|
|
107 |
st.markdown("**Team Name:** Sadia, Areeba, Rabbia, Tesmia")
|
108 |
st.markdown("**LLM Model:** Mistral")
|
109 |
|
110 |
+
# Input requirements manually
|
111 |
st.markdown("### Enter Requirements")
|
112 |
+
input_text = st.text_area("Enter your requirements (one per line or separated by periods):")
|
|
|
|
|
113 |
requirements = []
|
114 |
+
if input_text:
|
115 |
+
# Split by periods or newlines
|
116 |
+
requirements = [req.strip() for req in input_text.replace("\n", ".").split(".") if req.strip()]
|
|
|
|
|
|
|
117 |
|
118 |
# Analyze requirements
|
119 |
if st.button("Analyze Requirements"):
|
120 |
if not requirements:
|
121 |
+
st.warning("Please enter requirements.")
|
122 |
else:
|
123 |
results = []
|
124 |
for req in requirements:
|
|
|
136 |
st.write(f"**Rewritten:** {result['Rewritten']}")
|
137 |
st.write("---")
|
138 |
|
|
|
|
|
139 |
# Generate and download PDF report
|
140 |
pdf_report = generate_pdf_report(results)
|
141 |
with open(pdf_report, "rb") as f:
|
|
|
148 |
|
149 |
# Run the app
|
150 |
if __name__ == "__main__":
|
151 |
+
main()
|