tunght commited on
Commit
18e75be
·
1 Parent(s): 06f1913

don't run pospost process if guidance_prompt is empty

Browse files
Files changed (2) hide show
  1. app.py +3 -0
  2. requirements.txt +188 -13
app.py CHANGED
@@ -553,6 +553,9 @@ def get_language(struct_lang, copy_lang):
553
 
554
 
555
  def post_process(text: str, guidance_prompt: str, language: str, chat: ChatOpenAI):
 
 
 
556
  messages = [
557
  SystemMessage(content=f"""You are a helpful assistant that edit documents based on the guidelines provided.
558
  Make sure to write in {language} language."""),
 
553
 
554
 
555
  def post_process(text: str, guidance_prompt: str, language: str, chat: ChatOpenAI):
556
+ if guidance_prompt.strip() == "":
557
+ return text
558
+
559
  messages = [
560
  SystemMessage(content=f"""You are a helpful assistant that edit documents based on the guidelines provided.
561
  Make sure to write in {language} language."""),
requirements.txt CHANGED
@@ -1,13 +1,188 @@
1
- gradio
2
- langchain
3
- langchain_openai
4
- langchain_anthropic
5
- openai
6
- langchain_groq
7
- bcrypt
8
- langchain_chroma
9
- langchainhub
10
- langchain_community
11
- langchain-google-genai
12
- google-generativeai
13
- weave
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.2.1
2
+ aiohappyeyeballs==2.4.6
3
+ aiohttp==3.11.12
4
+ aiosignal==1.3.2
5
+ annotated-types==0.7.0
6
+ anthropic==0.49.0
7
+ anyio==4.8.0
8
+ asgiref==3.8.1
9
+ async-timeout==4.0.3
10
+ attrs==25.1.0
11
+ backoff==2.2.1
12
+ bcrypt==4.3.0
13
+ build==1.2.2.post1
14
+ cachetools==5.5.2
15
+ certifi==2025.1.31
16
+ chardet==3.0.4
17
+ charset-normalizer==3.4.1
18
+ chroma-hnswlib==0.7.6
19
+ chromadb==0.6.3
20
+ click==8.1.8
21
+ coloredlogs==15.0.1
22
+ dataclasses-json==0.6.7
23
+ defusedxml==0.7.1
24
+ Deprecated==1.2.18
25
+ diskcache==5.6.3
26
+ distro==1.9.0
27
+ docker-pycreds==0.4.0
28
+ durationpy==0.9
29
+ emoji==2.14.1
30
+ exceptiongroup==1.2.2
31
+ fastapi==0.115.8
32
+ ffmpy==0.5.0
33
+ filelock==3.18.0
34
+ filetype==1.2.0
35
+ flatbuffers==25.2.10
36
+ frozenlist==1.5.0
37
+ fsspec==2025.3.0
38
+ gitdb==4.0.12
39
+ GitPython==3.1.44
40
+ google-ai-generativelanguage==0.6.15
41
+ google-api-core==2.24.2
42
+ google-api-python-client==2.165.0
43
+ google-auth==2.38.0
44
+ google-auth-httplib2==0.2.0
45
+ google-genai==1.7.0
46
+ google-generativeai==0.8.4
47
+ googleapis-common-protos==1.69.2
48
+ gql==3.5.2
49
+ gradio==5.22.0
50
+ gradio_client==1.8.0
51
+ graphql-core==3.2.4
52
+ greenlet==3.1.1
53
+ groovy==0.1.2
54
+ groq==0.18.0
55
+ grpcio==1.71.0
56
+ grpcio-status==1.71.0
57
+ h11==0.14.0
58
+ h2==3.2.0
59
+ hpack==3.0.0
60
+ http3==0.6.7
61
+ httpcore==1.0.7
62
+ httplib2==0.22.0
63
+ httptools==0.6.4
64
+ httpx==0.28.1
65
+ httpx-sse==0.4.0
66
+ huggingface-hub==0.29.3
67
+ humanfriendly==10.0
68
+ hyperframe==5.2.0
69
+ idna==2.10
70
+ importlib_metadata==8.6.1
71
+ importlib_resources==6.5.2
72
+ iniconfig==2.0.0
73
+ Jinja2==3.1.6
74
+ jiter==0.8.2
75
+ jsonpatch==1.33
76
+ jsonpointer==3.0.0
77
+ jsonschema==4.23.0
78
+ jsonschema-specifications==2024.10.1
79
+ kubernetes==32.0.1
80
+ langchain==0.3.21
81
+ langchain-anthropic==0.3.10
82
+ langchain-chroma==0.2.2
83
+ langchain-community==0.3.20
84
+ langchain-core==0.3.46
85
+ langchain-google-genai==2.1.0
86
+ langchain-groq==0.3.0
87
+ langchain-openai==0.3.9
88
+ langchain-text-splitters==0.3.7
89
+ langchainhub==0.1.21
90
+ langchainplus-sdk==0.0.20
91
+ langsmith==0.1.147
92
+ loguru==0.7.3
93
+ markdown-it-py==3.0.0
94
+ MarkupSafe==3.0.2
95
+ marshmallow==3.26.1
96
+ mdurl==0.1.2
97
+ mmh3==5.1.0
98
+ monotonic==1.6
99
+ mpmath==1.3.0
100
+ multidict==6.1.0
101
+ mypy-extensions==1.0.0
102
+ numpy==1.26.4
103
+ oauthlib==3.2.2
104
+ onnxruntime==1.21.0
105
+ openai==1.67.0
106
+ opentelemetry-api==1.31.0
107
+ opentelemetry-exporter-otlp-proto-common==1.31.0
108
+ opentelemetry-exporter-otlp-proto-grpc==1.31.0
109
+ opentelemetry-instrumentation==0.52b0
110
+ opentelemetry-instrumentation-asgi==0.52b0
111
+ opentelemetry-instrumentation-fastapi==0.52b0
112
+ opentelemetry-proto==1.31.0
113
+ opentelemetry-sdk==1.31.0
114
+ opentelemetry-semantic-conventions==0.52b0
115
+ opentelemetry-util-http==0.52b0
116
+ orjson==3.10.15
117
+ overrides==7.7.0
118
+ packaging==24.2
119
+ pandas==2.2.3
120
+ pillow==11.1.0
121
+ platformdirs==4.3.7
122
+ pluggy==1.5.0
123
+ posthog==3.21.0
124
+ propcache==0.2.1
125
+ proto-plus==1.26.1
126
+ protobuf==5.29.4
127
+ psutil==7.0.0
128
+ pyasn1==0.6.1
129
+ pyasn1_modules==0.4.1
130
+ pydantic==2.10.6
131
+ pydantic-settings==2.8.1
132
+ pydantic_core==2.27.2
133
+ pydub==0.25.1
134
+ Pygments==2.19.1
135
+ pyparsing==3.2.1
136
+ PyPika==0.48.9
137
+ pyproject_hooks==1.2.0
138
+ pytest==8.3.4
139
+ python-dateutil==2.9.0.post0
140
+ python-dotenv==1.0.1
141
+ python-multipart==0.0.20
142
+ pytz==2025.1
143
+ PyYAML==6.0.2
144
+ referencing==0.36.2
145
+ regex==2024.11.6
146
+ requests==2.32.3
147
+ requests-oauthlib==2.0.0
148
+ requests-toolbelt==1.0.0
149
+ rfc3986==1.5.0
150
+ rich==13.9.4
151
+ rpds-py==0.23.1
152
+ rsa==4.9
153
+ ruff==0.11.0
154
+ safehttpx==0.1.6
155
+ semantic-version==2.10.0
156
+ sentry-sdk==2.23.1
157
+ setproctitle==1.3.5
158
+ shellingham==1.5.4
159
+ six==1.17.0
160
+ smmap==5.0.2
161
+ sniffio==1.3.1
162
+ SQLAlchemy==2.0.38
163
+ starlette==0.45.3
164
+ sympy==1.13.3
165
+ tenacity==8.5.0
166
+ tiktoken==0.9.0
167
+ tokenizers==0.21.1
168
+ tomli==2.2.1
169
+ tomlkit==0.13.2
170
+ tqdm==4.67.1
171
+ typer==0.15.2
172
+ types-requests==2.32.0.20250306
173
+ typing-inspect==0.9.0
174
+ typing_extensions==4.12.2
175
+ tzdata==2025.1
176
+ uritemplate==4.1.1
177
+ urllib3==2.3.0
178
+ uuid_utils==0.10.0
179
+ uvicorn==0.34.0
180
+ uvloop==0.21.0
181
+ wandb==0.19.8
182
+ watchfiles==1.0.4
183
+ weave==0.51.37
184
+ websocket-client==1.8.0
185
+ websockets==15.0.1
186
+ wrapt==1.17.2
187
+ yarl==1.18.3
188
+ zipp==3.21.0