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 1 commit
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
Prev Previous commit
Test (#1)
* Testing model

* Added model config, vocab, merges

* Revert testing
  • Loading branch information
copoer authored Jan 2, 2023
commit acf10708d7aca68ca68be7652a6eb6d6e5c2f881
33 changes: 33 additions & 0 deletions src/gpt2/gpt2_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,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 @@ -146,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 @@ -179,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