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

ERROR: 404 status code (no body) #340

Open
Sergio1998s opened this issue Jan 29, 2025 · 1 comment
Open

ERROR: 404 status code (no body) #340

Sergio1998s opened this issue Jan 29, 2025 · 1 comment

Comments

@Sergio1998s
Copy link

Hugging Face on Windows.
UI-TARS shows that it is thinking, but then doesn't proceed, but gives ERROR: 404 status code (no body)
How do you fix this ?

@zhoushaw
Copy link
Member

You can open your browser's console and execute the following code by pasting it there.

const apiKey = '<Token>'; // you token
const apiUrl = '<END_POINT>/v1';

// Request parameter
const requestBody = {
  model: "UI-TARS-7B-SFT", // set to the deploy model name
  messages: [
    { role: "system", content: "You are a helpful assistant" },
    { role: "user", content: "hello" }
  ],
  temperature: 0.7,
  max_tokens: 150
};

// Send request
fetch(apiUrl, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${apiKey}`
  },
  body: JSON.stringify(requestBody)
})
.then(response => {
  if (!response.ok) {
    throw new Error(`HTTP error! status: ${response.status}`);
  }
  return response.json();
})
.then(data => {
  console.log('Complete response:', data);
  const reply = data.choices[0].message.content;
  console.log('Assistant reply:', reply);
})
.catch(error => {
  console.error('Request failed:', error);
});

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

No branches or pull requests

2 participants