Input Length Exceeds Maximum Limit in LLama:8B Model API (Deep Infra) #515
Replies: 4 comments
-
|
@sanchitsingh001 I assume you are using the LLM extraction strategy, such limits relates to the model. However, you can fix the issue in certain ways. The LLM extraction strategy can chunk the content into smaller sizes, send each chunk to the LLM in parallel, and then combine the results. You can't adjust that threshold size. Share with me your codesnippet and the URL, and I will show you how to do that. I am working on a set of new documents where I explain the different strategies you can use. It is currently in draft mode. I will give you the links so you can check them and get some ideas. https://github.com/unclecode/crawl4ai/blob/main/docs/md_v3/tutorials/json-extraction-basic.md |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your detailed response and for sharing the helpful documentation links. I have attached the requested code snippet and the product page URL for reference. To provide more context, I primarily scrape e-commerce websites like Amazon and eBay to extract product details. However, I have encountered some challenges: Hallucinated Responses: The structured data returned often includes hallucinated entries. For example, if I provide a page containing a single product, the response may include a list of products that do not exist. Is using a more advanced LLM the only way to ensure highly accurate and reliable structured data? Here's my code: Define the schema for product detailsclass ProductDetails(BaseModel): Function to extract product details from the webpageasync def extract_product_details(): asyncio.run(extract_product_details()) |
Beta Was this translation helpful? Give feedback.
-
|
@sanchitsingh001 You're welcom, sure I will take a look on this, coming weekend. |
Beta Was this translation helpful? Give feedback.
-
|
Thank You |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Here's a clearer version of your message:
Hi,
I am using Deep Infra's model API, specifically the LLama:8B model, to scrape product data from e-commerce websites. However, for certain websites like amazon etc, I encounter the following error:
json
Copy code
{
"index": 0,
"error": true,
"tags": [
"error"
],
"content": "litellm.APIError: APIError: DeepinfraException - Error code: 500 - {'error': {'message': 'Requested input length 10452 exceeds maximum input length 8191'}}"
}
Is there a way to increase the input length, or can the model's structure handle longer inputs? If not, do you recommend any strategies for managing this limitation?
Beta Was this translation helpful? Give feedback.
All reactions