Skip to content

Commit

Permalink
refactor: Implement lazy loading for images in LandingPageDescription…
Browse files Browse the repository at this point in the history
… component
  • Loading branch information
Arghya721 committed Aug 12, 2024
1 parent b094eb9 commit a5289ca
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 23 deletions.
52 changes: 36 additions & 16 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import razorpay
from razorpay.resources.subscription import Subscription
from razorpay.resources.customer import Customer
from razorpay.resources.plan import Plan
from razorpay.resources.order import Order
import tiktoken
from anthropic import Anthropic
Expand Down Expand Up @@ -164,13 +163,6 @@ class PaymentRequest(BaseModel):
"input_token_cost_per_million": 10.0,
"output_token_cost_per_million": 30.0
},
"gpt-4": {
"model": ChatOpenAI,
"premium": True,
"company": "OpenAI",
"input_token_cost_per_million": 30.0,
"output_token_cost_per_million": 60.0
},
"gpt-4o-mini": {
"model": ChatOpenAI,
"premium": False,
Expand Down Expand Up @@ -269,33 +261,61 @@ class PaymentRequest(BaseModel):
"input_token_cost_per_million": 3.5,
"output_token_cost_per_million": 10.5
},
"sonar-small-chat": {
"llama-3-sonar-small-32k-online": {
"model": ChatPerplexity,
"premium": False,
"company": "Perplexity",
"input_token_cost_per_million": 0.2,
"output_token_cost_per_million": 0.2
},
"sonar-small-online": {
"llama-3-sonar-small-32k-chat": {
"model": ChatPerplexity,
"premium": True,
"company": "Perplexity",
"input_token_cost_per_million": 0.2,
"output_token_cost_per_million": 0.2
},
"sonar-medium-chat": {
"llama-3-sonar-large-32k-online": {
"model": ChatPerplexity,
"premium": False,
"company": "Perplexity",
"input_token_cost_per_million": 0.6,
"output_token_cost_per_million": 0.6
"input_token_cost_per_million": 1,
"output_token_cost_per_million": 1
},
"sonar-medium-online": {
"llama-3-sonar-large-32k-chat": {
"model": ChatPerplexity,
"premium": True,
"company": "Perplexity",
"input_token_cost_per_million": 0.6,
"output_token_cost_per_million": 0.6
"input_token_cost_per_million": 1,
"output_token_cost_per_million": 1
},
"llama-3.1-sonar-small-128k-online": {
"model": ChatPerplexity,
"premium": True,
"company": "Perplexity",
"input_token_cost_per_million": 0.2,
"output_token_cost_per_million": 0.2
},
"llama-3.1-sonar-small-128k-chat": {
"model": ChatPerplexity,
"premium": True,
"company": "Perplexity",
"input_token_cost_per_million": 0.2,
"output_token_cost_per_million": 0.2
},
"llama-3.1-sonar-large-128k-online": {
"model": ChatPerplexity,
"premium": True,
"company": "Perplexity",
"input_token_cost_per_million": 1,
"output_token_cost_per_million": 1
},
"llama-3.1-sonar-large-128k-chat": {
"model": ChatPerplexity,
"premium": True,
"company": "Perplexity",
"input_token_cost_per_million": 1,
"output_token_cost_per_million": 1
},
"codellama/CodeLlama-34b-Instruct-hf": {
"model": ChatTogether,
Expand Down
4 changes: 2 additions & 2 deletions web/src/components/LandingPageDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ export const LandingPageDescription = React.forwardRef((props, ref) => {
<p className="text-sm text-gray-500 dark:text-gray-400">A versatile language model from Perplexity.</p>
<Button className="justify-start" variant="link" onClick={async () => {
const isVerified = await verifyGoogleAuth();
if (isVerified) navigate('/chat', { state: { userModel: "sonar-medium-online" } });
if (isVerified) navigate('/chat', { state: { userModel: "llama-3.1-sonar-large-128k-online" } });

else {
model = "sonar-medium-online";
model = "llama-3.1-sonar-large-128k-online";
login();
}
}}>
Expand Down
13 changes: 8 additions & 5 deletions web/src/options/modelOptions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a5289ca

Please sign in to comment.