File size: 2,216 Bytes
de5d206
 
 
f8e1f84
c708f1d
9b8454a
de5d206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fab77f9
9e7becf
 
 
 
fab77f9
9e7becf
fab77f9
de5d206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c2e28ea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
language: 
- en
widget:
- text: "Generate a dialogue between two people about the following topic: At a quiet park, #Person1# stumbles upon an eerie crime scene, and #Person2#, a detective, arrives and begins to unravel the mysterious circumstances of the murder. Dialogue:"
  example_title: "Crime Scene"
tags:
- dialogue
- conversation-generator
- flan-t5-base
- fine-tuned
license: apache-2.0
datasets:
- kaggle-dialogue-dataset
---

# Omaratef3221/flan-t5-base-dialogue-generator

## Model Description
This model is a fine-tuned version of Google's `t5` specifically tailored for generating realistic and engaging dialogues or conversations. 
It has been trained to capture the nuances of human conversation, making it highly effective for applications requiring conversational AI capabilities.

## Intended Use
`Omaratef3221/flan-t5-base-dialogue-generator` is ideal for developing chatbots, virtual assistants, and other applications where generating human-like dialogue is crucial. 
It can also be used for research and development in natural language understanding and generation.

## How to Use
You can use this model directly with the transformers library as follows:

### Download the model
```python
model_name = "Omaratef3221/flan-t5-base-dialogue-generator"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
```

### Use with example
```python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

model_name = "Omaratef3221/flan-t5-base-dialogue-generator"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)

prompt = '''
Generate a dialogue between two people about the following topic:
A local street market bustles with activity, #Person1# tries exotic food for the first time, and #Person2#, familiar with the cuisine, offers insights and recommendations.
Dialogue:
'''
# Generate a response to an input statement
input_ids = tokenizer(prompt, return_tensors='pt').input_ids
output = model.generate(input_ids, top_p = 0.6, do_sample=True, temperature = 1.2, max_length = 512)
print(tokenizer.decode(output[0], skip_special_tokens=True).replace('. ', '.\n'))
```