rsrini7 commited on
Commit
d499f0a
·
1 Parent(s): 1345cba

dynamically added input text limit and removed .idea folder

Browse files
.gitignore CHANGED
@@ -144,3 +144,4 @@ dmypy.json
144
  # Cython debug symbols
145
  cython_debug/
146
 
 
 
144
  # Cython debug symbols
145
  cython_debug/
146
 
147
+ .idea
.idea/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- # Default ignored files
2
- /shelf/
3
- /workspace.xml
 
 
 
 
.idea/inspectionProfiles/Project_Default.xml DELETED
@@ -1,14 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
5
- <option name="ignoredPackages">
6
- <value>
7
- <list size="1">
8
- <item index="0" class="java.lang.String" itemvalue="numpy" />
9
- </list>
10
- </value>
11
- </option>
12
- </inspection_tool>
13
- </profile>
14
- </component>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
.idea/inspectionProfiles/profiles_settings.xml DELETED
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <settings>
3
- <option name="USE_PROJECT_PROFILE" value="false" />
4
- <version value="1.0" />
5
- </settings>
6
- </component>
 
 
 
 
 
 
 
.idea/misc.xml DELETED
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Black">
4
- <option name="sdkName" value="Python 3.10 (slide-deck-ai)" />
5
- </component>
6
- <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (slide-deck-ai)" project-jdk-type="Python SDK" />
7
- </project>
 
 
 
 
 
 
 
 
.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/slide-deck-ai.iml" filepath="$PROJECT_DIR$/.idea/slide-deck-ai.iml" />
6
- </modules>
7
- </component>
8
- </project>
 
 
 
 
 
 
 
 
 
.idea/slide-deck-ai.iml DELETED
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="PYTHON_MODULE" version="4">
3
- <component name="NewModuleRootManager">
4
- <content url="file://$MODULE_DIR$">
5
- <excludeFolder url="file://$MODULE_DIR$/venv" />
6
- </content>
7
- <orderEntry type="inheritedJdk" />
8
- <orderEntry type="sourceFolder" forTests="false" />
9
- </component>
10
- </module>
 
 
 
 
 
 
 
 
 
 
 
.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
- </component>
6
- </project>
 
 
 
 
 
 
 
app.py CHANGED
@@ -172,6 +172,19 @@ with st.sidebar:
172
  horizontal=True
173
  )
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  if RUN_IN_OFFLINE_MODE:
176
  llm_provider_to_use = st.text_input(
177
  label='2: Enter Ollama model name to use (e.g., mistral:v0.2):',
@@ -291,7 +304,7 @@ def set_up_chat_ui():
291
 
292
  if prompt := st.chat_input(
293
  placeholder=APP_TEXT['chat_placeholder'],
294
- max_chars=GlobalConfig.LLM_MODEL_MAX_INPUT_LENGTH,
295
  accept_file=True,
296
  file_type=['pdf', ],
297
  ):
 
172
  horizontal=True
173
  )
174
 
175
+ # --- LLM Max Input Length Config ---
176
+ # Only set session state if not already set by user
177
+ if 'llm_max_input_length' not in st.session_state:
178
+ st.session_state['llm_max_input_length'] = 400
179
+ llm_max_input_length = st.sidebar.number_input(
180
+ 'Max LLM Input Length (characters)',
181
+ min_value=100,
182
+ max_value=20000,
183
+ step=100,
184
+ key='llm_max_input_length',
185
+ help='Maximum number of characters allowed for the LLM input prompt.'
186
+ )
187
+
188
  if RUN_IN_OFFLINE_MODE:
189
  llm_provider_to_use = st.text_input(
190
  label='2: Enter Ollama model name to use (e.g., mistral:v0.2):',
 
304
 
305
  if prompt := st.chat_input(
306
  placeholder=APP_TEXT['chat_placeholder'],
307
+ max_chars=st.session_state.get('llm_max_input_length', 400),
308
  accept_file=True,
309
  file_type=['pdf', ],
310
  ):
global_config.py CHANGED
@@ -100,8 +100,6 @@ class GlobalConfig:
100
  )
101
  DEFAULT_MODEL_INDEX = int(os.environ.get('DEFAULT_MODEL_INDEX', '4'))
102
  LLM_MODEL_TEMPERATURE = 0.2
103
- LLM_MODEL_MIN_OUTPUT_LENGTH = 100
104
- LLM_MODEL_MAX_INPUT_LENGTH = 10000 # characters
105
  MAX_PAGE_COUNT = 50
106
 
107
  LOG_LEVEL = 'DEBUG'
 
100
  )
101
  DEFAULT_MODEL_INDEX = int(os.environ.get('DEFAULT_MODEL_INDEX', '4'))
102
  LLM_MODEL_TEMPERATURE = 0.2
 
 
103
  MAX_PAGE_COUNT = 50
104
 
105
  LOG_LEVEL = 'DEBUG'