Skip to content

Commit

Permalink
Merge pull request #410 from truefoundry/fix/multimodal-controller
Browse files Browse the repository at this point in the history
fix: multi modal parser and set qa max upload size to 200MB
  • Loading branch information
mnvsk97 authored Nov 26, 2024
2 parents 6ce9fcf + 0bf79cd commit 10593ff
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion backend/modules/query_controllers/multimodal/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MultiModalRAGQueryController(BaseQueryController):
async def _stream_vlm_answer(self, llm, message_payload, docs):
try:
async with async_timeout.timeout(GENERATION_TIMEOUT_SEC):
yield Docs(content=self._cleanup_metadata(docs))
yield Docs(content=self._enrich_context_for_stream_response(docs))
async for chunk in llm.astream(message_payload):
yield Answer(content=chunk.content)
except asyncio.TimeoutError:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'

import { MenuItem, Select } from '@mui/material'
import { FormControl, MenuItem, Select } from '@mui/material'

interface ConfigProps {
title: string
Expand All @@ -25,31 +25,33 @@ const ConfigSelector = (props: ConfigProps) => {
return (
<div className={`flex justify-between items-center ${className}`}>
<div className="text-sm">{title}:</div>
<Select
value={initialValue}
onChange={(e) => handleOnChange(e)}
placeholder={placeholder + '...'}
sx={{
background: 'white',
height: '2rem',
width: '13.1875rem',
border: '1px solid #CEE0F8 !important',
outline: 'none !important',
'& fieldset': {
border: 'none !important',
},
}}
>
{data?.map((item: any) =>
renderItem ? (
renderItem(item)
) : (
<MenuItem value={item} key={item}>
{item}
</MenuItem>
),
)}
</Select>
<FormControl>
<Select
value={initialValue}
onChange={(e) => handleOnChange(e)}
label={placeholder + '...'}
sx={{
background: 'white',
height: '2rem',
width: '13.1875rem',
border: '1px solid #CEE0F8 !important',
outline: 'none !important',
'& fieldset': {
border: 'none !important',
},
}}
>
{data?.map((item: any) =>
renderItem ? (
renderItem(item)
) : (
<MenuItem value={item} key={item}>
{item}
</MenuItem>
),
)}
</Select>
</FormControl>
</div>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,20 @@ const Left = (props: any) => {
{allRetrieverOptions && selectedRetriever?.key && (
<ConfigSelector
title="Retriever"
placeholder="Select Retriever..."
initialValue={selectedRetriever?.summary}
placeholder="Select Retriever"
initialValue={selectedRetriever?.key}
data={allRetrieverOptions}
className="mt-4"
handleOnChange={(e) => {
console.log(allRetrieverOptions.map((retriever) => retriever.key))
const retriever = allRetrieverOptions.find(
(retriever) => retriever.key === e.target.value,
)
setSelectedRetriever(retriever)
setPromptTemplate(retriever?.promptTemplate)
}}
renderItem={(item) => (
<MenuItem key={item.key} value={item.summary}>
<MenuItem key={item.key} value={item.key}>
{item.summary}
</MenuItem>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/stores/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const IS_DOCS_QA_REDIRECT_ENABLED =
export const DOCS_QA_STANDALONE_PATH = import.meta.env
.VITE_DOCS_QA_STANDALONE_PATH
export const DOCS_QA_MAX_UPLOAD_SIZE_MB = parseInt(
import.meta.env.VITE_DOCS_QA_MAX_UPLOAD_SIZE_MB || '2'
import.meta.env.VITE_DOCS_QA_MAX_UPLOAD_SIZE_MB || '200'
)
export const IS_LOCAL_DEVELOPMENT = import.meta.env.VITE_USE_LOCAL === 'true'
export const GTAG_ID = import.meta.env.VITE_GTAG_ID
Expand Down

0 comments on commit 10593ff

Please sign in to comment.