Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
b4fe248b
Unverified
Commit
b4fe248b
authored
May 04, 2023
by
Nicolas Patry
Committed by
GitHub
May 04, 2023
Browse files
fix(launcher): handle hub branches (#278)
parent
b67908e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
router/src/main.rs
router/src/main.rs
+4
-3
No files found.
router/src/main.rs
View file @
b4fe248b
...
@@ -258,9 +258,10 @@ fn init_logging(otlp_endpoint: Option<String>, json_output: bool) {
...
@@ -258,9 +258,10 @@ fn init_logging(otlp_endpoint: Option<String>, json_output: bool) {
/// get model info from the Huggingface Hub
/// get model info from the Huggingface Hub
pub
async
fn
get_model_info
(
model_id
:
&
str
,
revision
:
&
str
,
token
:
Option
<
String
>
)
->
HubModelInfo
{
pub
async
fn
get_model_info
(
model_id
:
&
str
,
revision
:
&
str
,
token
:
Option
<
String
>
)
->
HubModelInfo
{
let
client
=
reqwest
::
Client
::
new
();
let
client
=
reqwest
::
Client
::
new
();
let
mut
builder
=
client
.get
(
format!
(
// Poor man's urlencode
"https://huggingface.co/api/models/{model_id}/revision/{revision}"
let
revision
=
revision
.replace
(
"/"
,
"%2F"
);
));
let
url
=
format!
(
"https://huggingface.co/api/models/{model_id}/revision/{revision}"
);
let
mut
builder
=
client
.get
(
url
);
if
let
Some
(
token
)
=
token
{
if
let
Some
(
token
)
=
token
{
builder
=
builder
.bearer_auth
(
token
);
builder
=
builder
.bearer_auth
(
token
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment