10000 🚚 Rename questionAnswer to questionAnswering · huggingface/huggingface.js@945e604 · GitHub
[go: up one dir, main page]

Skip to content

Commit 945e604

Browse files
committed
🚚 Rename questionAnswer to questionAnswering
Fix #145
1 parent 126df2e commit 945e604

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

‎packages/inference/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ await hf.summarization({
4545
}
4646
})
4747

48-
await hf.questionAnswer({
48+
await hf.questionAnswering({
4949
model: 'deepset/roberta-base-squad2',
5050
inputs: {
5151
question: 'What is the capital of France?',
5252
context: 'The capital of France is Paris.'
5353
}
5454
})
5555

56-
await hf.tableQuestionAnswer({
56+
await hf.tableQuestionAnswering({
5757
model: 'google/tapas-base-finetuned-wtq',
5858
inputs: {
5959
query: 'How many stars does the transformers repository have?',

‎packages/inference/src/HfInference.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ export interface SummarizationReturn {
102102
summary_text: string;
103103
}
104104

105-
export type QuestionAnswerArgs = Args & {
105+
export type QuestionAnsweringArgs = Args & {
106106
inputs: {
107107
context: string;
108108
question: string;
109109
};
110110
};
111111

112-
export interface QuestionAnswerReturn {
112+
export interface QuestionAnsweringReturn {
113113
/**
114114
* A string that’s the answer within the text.
115115
*/
@@ -128,7 +128,7 @@ export interface QuestionAnswerReturn {
128128
start: number;
129129
}
130130

131-
export type TableQuestionAnswerArgs = Args & {
131+
export type TableQuestionAnsweringArgs = Args & {
132132
inputs: {
133133
/**
134134
* The query in plain text that you want to ask the table
@@ -141,7 +141,7 @@ export type TableQuestionAnswerArgs = Args & {
141141
};
142142
};
143143

144-
export interface TableQuestionAnswerReturn {
144+
export interface TableQuestionAnsweringReturn {
145145
/**
146146
* The aggregator used to get the answer
147147
*/
@@ -694,8 +694,8 @@ export class HfInference {
694694
/**
695695
* Want to have a nice know-it-all bot that can answer any question?. Recommended model: deepset/roberta-base-squad2
696696
*/
697-
public async questionAnswer(args: QuestionAnswerArgs, options?: Options): Promise<QuestionAnswerReturn> {
698-
const res = await this.request<QuestionAnswerReturn>(args, options);
697+
public async questionAnswering(args: QuestionAnsweringArgs, options?: Options): Promise<QuestionAnsweringReturn> {
698+
const res = await this.request<QuestionAnsweringReturn>(args, options);
699699
const isValidOutput =
700700
typeof res.answer === "string" &&
701701
typeof res.end === "number" &&
@@ -712,11 +712,11 @@ export class HfInference {
712712
/**
713713
* Don’t know SQL? Don’t want to dive into a large spreadsheet? Ask questions in plain english! Recommended model: google/tapas-base-finetuned-wtq.
714714
*/
715-
public async tableQuestionAnswer(
716-
args: TableQuestionAnswerArgs,
715+
public async tableQuestionAnswering(
716+
args: TableQuestionAnsweringArgs,
717717
options?: Options
718-
): Promise<TableQuestionAnswerReturn> {
719-
const res = await this.request<TableQuestionAnswerReturn>(args, options);
718+
): Promise<TableQuestionAnsweringReturn> {
719+
const res = await this.request<TableQuestionAnsweringReturn>(args, options);
720720
const isValidOutput =
721721
typeof res.aggregator === "string" &&
722722
typeof res.answer === "string" &&

‎packages/inference/test/HfInference.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ describe.concurrent(
6060
});
6161
});
6262

63-
it("questionAnswer", async () => {
63+
it("questionAnswering", async () => {
6464
expect(
65-
await hf.questionAnswer({
65+
await hf.questionAnswering({
6666
model: "deepset/roberta-base-squad2",
6767
inputs: {
6868
question: "What is the capital of France?",
@@ -77,9 +77,9 @@ describe.concurrent(
7777
});
7878
});
7979

80-
it("table question answer", async () => {
80+
it("tableQuestionAnswering", async () => {
8181
expect(
82-
await hf.tableQuestionAnswer({
82+
await hf.tableQuestionAnswering({
8383
model: "google/tapas-base-finetuned-wtq",
8484
inputs: {
8585
query: "How many stars does the transformers repository have?",

0 commit comments

Comments
 (0)
0