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

Added DialoGPT Small and Large Models #317

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
43 changes: 43 additions & 0 deletions src/gpt2/gpt2_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,21 @@ impl Gpt2ModelResources {
"distilgpt2/model",
"https://huggingface.co/distilgpt2/resolve/main/rust_model.ot",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-small>. Modified with conversion to C-array format.
pub const DIALOGPT_SMALL: (&'static str, &'static str) = (
"dialogpt-small/model",
"https://huggingface.co/microsoft/DialoGPT-small/resolve/main/rust_model.ot",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-medium>. Modified with conversion to C-array format.
pub const DIALOGPT_MEDIUM: (&'static str, &'static str) = (
"dialogpt-medium/model",
"https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/rust_model.ot",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-large>. Modified with conversion to C-array format.
pub const DIALOGPT_LARGE: (&'static str, &'static str) = (
"dialogpt-large/model",
"https://huggingface.co/microsoft/DialoGPT-large/resolve/main/rust_model.ot",
);
}

impl Gpt2ConfigResources {
Expand Down Expand Up @@ -103,11 +113,23 @@ impl Gpt2ConfigResources {
"distilgpt2/config",
"https://huggingface.co/distilgpt2/resolve/main/config.json",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-small>. Modified with conversion to C-array format.
pub const DIALOGPT_SMALL: (&'static str, &'static str) = (
"dialogpt-small/config",
"https://huggingface.co/microsoft/DialoGPT-small/resolve/main/config.json",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-medium>. Modified with conversion to C-array format.
pub const DIALOGPT_MEDIUM: (&'static str, &'static str) = (
"dialogpt-medium/config",
"https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/config.json",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-large>. Modified with conversion to C-array format.
pub const DIALOGPT_LARGE: (&'static str, &'static str) = (
"dialogpt-large/config",
"https://huggingface.co/microsoft/DialoGPT-large/resolve/main/config.json",
);


}

impl Gpt2VocabResources {
Expand Down Expand Up @@ -136,11 +158,21 @@ impl Gpt2VocabResources {
"distilgpt2/vocab",
"https://huggingface.co/distilgpt2/resolve/main/vocab.json",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-small>. Modified with conversion to C-array format.
pub const DIALOGPT_SMALL: (&'static str, &'static str) = (
"dialogpt-small/vocab",
"https://huggingface.co/microsoft/DialoGPT-small/resolve/main/vocab.json",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-medium>. Modified with conversion to C-array format.
pub const DIALOGPT_MEDIUM: (&'static str, &'static str) = (
"dialogpt-medium/vocab",
"https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/vocab.json",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-large>. Modified with conversion to C-array format.
pub const DIALOGPT_LARGE: (&'static str, &'static str) = (
"dialogpt-large/vocab",
"https://huggingface.co/microsoft/DialoGPT-large/resolve/main/vocab.json",
);
}

impl Gpt2MergesResources {
Expand Down Expand Up @@ -169,11 +201,22 @@ impl Gpt2MergesResources {
"distilgpt2/merges",
"https://huggingface.co/distilgpt2/resolve/main/merges.txt",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-small>. Modified with conversion to C-array format.
pub const DIALOGPT_SMALL: (&'static str, &'static str) = (
"dialogpt-small/merges",
"https://huggingface.co/microsoft/DialoGPT-small/resolve/main/merges.txt",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-medium>. Modified with conversion to C-array format.
pub const DIALOGPT_MEDIUM: (&'static str, &'static str) = (
"dialogpt-medium/merges",
"https://huggingface.co/microsoft/DialoGPT-medium/resolve/main/merges.txt",
);
/// Shared under MIT license by the Microsoft team at <https://huggingface.co/microsoft/DialoGPT-large>. Modified with conversion to C-array format.
pub const DIALOGPT_LARGE: (&'static str, &'static str) = (
"dialogpt-large/merges",
"https://huggingface.co/microsoft/DialoGPT-large/resolve/main/merges.txt",
);

}

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand Down