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

🐛 fix: fix parameter conditions for perplexity #1394

Closed
wants to merge 4 commits into from

Conversation

gijigae
Copy link
Contributor

@gijigae gijigae commented Feb 26, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • ⚡️ perf
  • 📝 docs

🔀 变更说明 | Description of Change

Updated the paramter conditions for Perplexity to resolve #1368 . Perplexity only accepts either frequency_penalty or presence_penalty, and not both. If the value of presence_penalty is something other than 0, the presence_penality will be passed to a model.

📝 补充信息 | Additional Information

The details will be added to a document as well.

Copy link

vercel bot commented Feb 26, 2024

@gijigae is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @gijigae

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 86.32%. Comparing base (42ea0f5) to head (da9b73c).
Report is 5 commits behind head on main.

Files Patch % Lines
src/libs/agent-runtime/perplexity/index.ts 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1394      +/-   ##
==========================================
- Coverage   86.33%   86.32%   -0.01%     
==========================================
  Files         217      218       +1     
  Lines       11059    11118      +59     
  Branches     1177     1186       +9     
==========================================
+ Hits         9548     9598      +50     
- Misses       1511     1520       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is a little confusing, I think need to write in a better way. let me try it

@gijigae
Copy link
Contributor Author

gijigae commented Feb 28, 2024

Thanks @arvinxx for the feedback! Really appreciate your help. Tried the approach in ZhipuAI, but the response received from Perplexity were somewhat repetitive.

private buildCompletionsParams(payload: ChatStreamPayload) {

@lobehubbot lobehubbot self-requested a review February 28, 2024 11:48
@arvinxx
Copy link
Contributor

arvinxx commented Feb 28, 2024

@gijigae I have update the code, please check whether it works well?

@gijigae
Copy link
Contributor Author

gijigae commented Feb 28, 2024

Thanks @arvinxx for the update! Tested and it's showing same words over and over. Will check what's causing the problem.

image

@arvinxx
Copy link
Contributor

arvinxx commented Mar 25, 2024

@gijigae hi, is there any update?

@gijigae
Copy link
Contributor Author

gijigae commented Mar 26, 2024

@gijigae hi, is there any update?

Hello @arvinxx , I'm still trying to figure out why Perplexity returns gibburish data with the code you updated.

@arvinxx arvinxx mentioned this pull request May 9, 2024
12 tasks
@arvinxx arvinxx closed this in #2439 May 9, 2024
@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 0.156.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] perplexity :[code: 400 | message: Cannot set both presence_penalty and frequency_penalty.]
3 participants