Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with extra spaces being added to LLM responses during combine. #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion current/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ requests
langchain
huggingface-hub
sentence-transformers
python-dotenv
python-dotenv
langchain_community
langchain_huggingface
chromadb
4 changes: 3 additions & 1 deletion current/td-llm-dnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def api_call(model: str, prompt: str, max_tokens: int) -> str:
return "Error: No valid JSON objects found in response."


combined_response = " ".join([obj.get("response", "") for obj in json_objects])
combined_response = "".join([obj.get("response", "") for obj in json_objects])

return combined_response

except requests.RequestException as e:
Expand Down Expand Up @@ -141,6 +142,7 @@ def manage_models():
player_model = st.selectbox("AI Player Model", models,
index=models.index(st.session_state.get('player_model', models[0])))
embedding_model = st.selectbox("RAG Embedding Model", ["sentence-transformers/all-mpnet-base-v2",
"sentence-transformers/all-MiniLM-L12-v2",
"sentence-transformers/all-MiniLM-L6-v2"])

if st.button("Save Model Selections"):
Expand Down