Skip to content

Commit

Permalink
Relax dependencies fix bug (#305)
Browse files Browse the repository at this point in the history
* Wording fixes in prompt_examples.md (#303)

A few typo fixes in promp_examples.md.

* "Question Answer" should be "Question Answering"
* "Machine Reading" is a bit of an esoteric technical term, and can probably be removed.
* "Japanese-to-Python" is simpler English.

* fix bug when sequnece max length is None

* lint

---------

Co-authored-by: zhaochen20 <[email protected]>
Co-authored-by: Graham Neubig <[email protected]>
  • Loading branch information
3 people authored Aug 29, 2023
1 parent 0c39d35 commit 6b76bba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion prompt2model/model_executor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ def __init__(
self.tokenizer_max_length = tokenizer_max_length
self.sequence_max_length = sequence_max_length
if self.sequence_max_length is None:
max_length = self.model.config.max_length
logger.warning(
(
"The `max_length` in `self.model.generate` will default to "
f"`self.model.config.max_length` ({self.model.config.max_length})"
f"`self.model.config.max_length` ({max_length})"
" if `sequence_max_length` is `None`."
)
)
self.sequence_max_length = max_length
if hasattr(self.model.config, "max_position_embeddings"):
max_embeddings = self.model.config.max_position_embeddings
if sequence_max_length is not None and sequence_max_length > max_embeddings:
Expand Down
4 changes: 2 additions & 2 deletions prompt_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ about the format and scope of your examples.

Here are some examples of good prompts:

### Machine Reading Question Answer
### Question Answering

```text
"""Your task is to generate an answer to a natural question. In this task, the input is a string that consists of both a question and a context passage. The context is a descriptive passage related to the question and contains the answer. And the question can range from Math, Cultural, Social, Geometry, Biology, History, Sports, Technology, Science, and so on.
Expand Down Expand Up @@ -113,7 +113,7 @@ output="N/A"
"""
```

### Japanese2Python Generation
### Japanese-to-Python Generation

```text
"""Pythonで1行のコードを生成し、StackOverflowの日本語の質問を解決してください。コメントや式は含めないでください。インポート文も不要です。
Expand Down

0 comments on commit 6b76bba

Please sign in to comment.