CoolFace
Apppublic

LookslikeR/Quotes

sourceHugging Faceotherupdated 2y agoView on Hugging Face
0likes
app.py79 linesDownload Raw Back to root
1# -*- coding: utf-8 -*-2"""randomquote.ipynb3 4Automatically generated by Colab.5 6Original file is located at7    https://colab.research.google.com/drive/1K-bDOKOCAMb3EuaLXHXJVoBbIMtHqBjW8"""9 10# !pip install gradio11import gradio as gr12import random13 14# Dictionary of philosopher quotes15quotes = {16    "Socrates": "The unexamined life is not worth living.",17    "Plato": "Wise men speak because they have something to say; fools because they have to say something.",18    "Aristotle": "Knowing yourself is the beginning of all wisdom.",19    "Confucius": "It does not matter how slowly you go as long as you do not stop.",20    "Nietzsche": "He who has a why to live can bear almost any how.",21    "Descartes": "I think, therefore I am.",22    "Kant": "Science is organized knowledge. Wisdom is organized life.",23    "Hobbes": "Leisure is the mother of philosophy.",24    "Rousseau": "Man is born free and everywhere he is in chains.",25    "Spinoza": "The highest activity a human being can attain is learning for understanding, because to understand is to be free.",26    "Hegel": "Nothing great in the world has ever been accomplished without passion.",27    "Schopenhauer": "Talent hits a target no one else can hit; Genius hits a target no one else can see.",28    "Marx": "The philosophers have only interpreted the world, in various ways. The point, however, is to change it.",29    "Mill": "The only freedom which deserves the name is that of pursuing our own good in our own way.",30    "Heidegger": "Being is the most self-evident and yet the most difficult thing to think.",31    "Sartre": "Man is condemned to be free; because once thrown into the world, he is responsible for everything he does.",32    "Camus": "The only way to deal with an unfree world is to become so absolutely free that your very existence is an act of rebellion.",33    "Wittgenstein": "The limits of my language mean the limits of my world.",34    "Derrida": "There is nothing outside the text.",35    "Foucault": "Knowledge is not for knowing: knowledge is for cutting.",36    "Locke": "No man's knowledge here can go beyond his experience.",37    "Berkeley": "To be is to be perceived.",38    "Hume": "Custom is the great guide of human life.",39    "Kierkegaard": "Life can only be understood backwards; but it must be lived forwards.",40    "Russell": "The good life is one inspired by love and guided by knowledge.",41    "Rawls": "Justice is the first virtue of social institutions.",42    "Levinas": "Ethics is the first philosophy.",43    "Freud": "Where id was, there ego shall be.",44    "James": "The greatest discovery of any generation is that a human can alter his life by altering his attitude.",45    "Dewey": "Education is not preparation for life; education is life itself.",46    "Habermas": "Knowledge and human interest are inseparable.",47    "Simone de Beauvoir": "One is not born, but rather becomes, a woman.",48    "Merleau-Ponty": "We are caught up in the world and we do not succeed in extricating ourselves from it.",49    "Adorno": "The task of art today is to bring chaos into order.",50    "Rorty": "Truth is what your contemporaries let you get away with."51}52 53# Function to get a random quote54def random_quote():55    philosopher, quote = random.choice(list(quotes.items()))56    return f"{philosopher}: \"{quote}\""57 58# Function to display "under construction" message59def under_construction():60    return "Still under construction..."61 62# Gradio Interface63with gr.Blocks() as app:64    with gr.Tabs():65        with gr.TabItem("Philosopher Quotes"):66            gr.Markdown("**Click the button below to see a random philosopher quote. No need to enter any text!**")67            quote_display = gr.Textbox(label="Philosopher Quote", interactive=False)68            next_quote = gr.Button("Next Quote")69            next_quote.click(fn=random_quote, outputs=quote_display)70        71        with gr.TabItem("Anime Recommendations"):72            construction_display = gr.Textbox(value="Still under construction...", label="Status", interactive=False)73 74# Launch the app with authentication75if __name__ == "__main__":76    app.launch(auth=("cyborg","awesomeness"))77# app.launch()78 79