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

ENH: UI supports registering custom gptq models #875

Merged
merged 2 commits into from
Jan 9, 2024
Merged
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
23 changes: 22 additions & 1 deletion xinference/web/ui/src/scenes/register_model/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ const RegisterModel = () => {
return modelFormat === 'pytorch'
}

const isModelFormatGPTQ = () => {
return modelFormat === 'gptq'
}

const getPathComponents = (path) => {
const normalizedPath = path.replace(/\\/g, '/')
const baseDir = normalizedPath.substring(0, normalizedPath.lastIndexOf('/'))
Expand All @@ -171,7 +175,17 @@ const RegisterModel = () => {
}

const handleClick = async () => {
if (!isModelFormatPytorch()) {
if (isModelFormatGPTQ()) {
formData.model_specs = [
{
model_format: modelFormat,
model_size_in_billions: modelSize,
quantizations: [''],
model_id: '',
model_uri: modelUri,
},
]
} else if (!isModelFormatPytorch()) {
const { baseDir, filename } = getPathComponents(modelUri)
formData.model_specs = [
{
Expand Down Expand Up @@ -345,6 +359,13 @@ const RegisterModel = () => {
label="GGUF"
/>
</Box>
<Box sx={{ marginLeft: '10px' }}>
<FormControlLabel
value="gptq"
control={<Radio />}
label="GPTQ"
/>
</Box>
</Box>
</RadioGroup>
<Box padding="15px"></Box>
Expand Down
Loading