File size: 2,921 Bytes
5c42e06
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa20994
5c42e06
 
aa20994
 
5c42e06
 
aa20994
5c42e06
 
aa20994
5c42e06
 
 
 
aa20994
5c42e06
 
aa20994
5c42e06
 
 
 
 
 
 
 
 
 
 
 
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
description = """Gradio Demo for BLOOM. To use it, simply add your text, or click one of the examples to load them.
Tips:
- Do NOT talk to BLOOM as an entity, it's not a chatbot but a webpage/blog/article completion model.
- For the best results: MIMIC a few sentences of a webpage similar to the content you want to generate.
Start a paragraph as if YOU were writing a blog, webpage, math post, coding article and BLOOM will generate a coherent follow-up. Longer prompts usually give more interesting results.
Options:
- sampling: imaginative completions (may be not super accurate e.g. math/history)
- greedy: accurate completions (may be more boring or have repetitions)
"""

wip_description = """JAX / Flax Gradio Demo for BLOOM. The 176B BLOOM model running on a TPU v3-256 pod, with 2D model parallelism and custom mesh axes.
Note:
1. For this WIP demo, only **sampling** is supported.
2. Rendering of the screenshot is currently not optimised. To experience the true speed of JAX / Flax, tick 'just output raw text'.
"""

examples = [
    [
        'A "whatpu" is a small, furry animal native to Tanzania. An example of a sentence that uses the word whatpu is: We were traveling in Africa and we saw these very cute whatpus. To do a "farduddle" means to jump up and down really fast. An example of a sentence that uses the word farduddle is:',
        64, "sampling", True, "Sample", ],
    ['A poem about the beauty of science by Alfred Edgar Brittle\nTitle: The Magic Craft\nIn the old times', 64,
     "sampling", True],
    ['استخراج العدد العاملي في لغة بايثون:', 64, "Sample", "Sample 1"],
    ["Pour déguster un ortolan, il faut tout d'abord", 64,"Sample", "Sample 1"],
    [
        'Traduce español de España a español de Argentina\nEl coche es rojo - el auto es rojo\nEl ordenador es nuevo - la computadora es nueva\nel boligrafo es negro -',
        64, "Sample", "Sample 1"],
    [
        'Estos ejemplos quitan vocales de las palabras\nEjemplos:\nhola - hl\nmanzana - mnzn\npapas - pps\nalacran - lcrn\npapa -',
        64, "Sample", "Sample 1""sampling", True],
    ["Question: If I put cheese into the fridge, will it melt?\nAnswer:", 64, "sampling", True],
    ["Math exercise - answers:\n34+10=44\n54+20=", 64, "sampling", True],
    [
        "Question: Where does the Greek Goddess Persephone spend half of the year when she is not with her mother?\nAnswer:",
        64, "Sample", "Sample 1"],
    [
        "spelling test answers.\nWhat are the letters in « language »?\nAnswer: l-a-n-g-u-a-g-e\nWhat are the letters in « Romanian »?\nAnswer:",
        64, "Sample", "Sample 1"]
]

initial_prompt_value = """استخراج العدد العاملي في لغة بايثون :
def factorial(n):
    if n == 0:
        return 1
    else:
        result = 1
        for i in range(1, n + 1) :
            result *= i
    return result
print(factorial(5))"""